
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
|PyPi Status| |Build Status| |Coverage Status| |Wheel Status| |Python versions|
This library is meant to interface with mijnafvalwijzer <http://www.mijnafvalwijzer.nl/>
__.
It is meant as a workaround for the afvalwijzer app (used in the Netherlands) to be notified when to place the bin at the road. Since this app delivers a poor functionality for notifications, and I needed a small project, I created this.
.. code:: bash
pip install afvalwijzer
.. code:: bash
pip uninstall afvalwijzer
.. code:: python
>>> from Afvalwijzer import Afvalwijzer
>>> zipcode = '3564KV'
>>> number = '13'
>>> garbage = Afvalwijzer(zipcode, number)
>>> garbage.pickupdate
'Vandaag'
>>> garbage.wastetype
'Groente-, Fruit- en Tuinafval'
>>> garbage.garbage
('Vandaag', 'Groente-, Fruit- en Tuinafval')
>>> garbage.pickupdates
['dinsdag 02 januari', 'dinsdag 02 januari']
>>> garbage.wastetypes
['Groente-, Fruit- en Tuinafval', 'Kerstbomen']
The following function only returns true if the pickup date is the same as today.
.. code:: python
>>> garbage.notify
True
Below is shown how I use it to get notified using pushbullet.
.. code:: python
from Afvalwijzer import Afvalwijzer
from pushbullet import Pushbullet
def notification(device=None):
pb = Pushbullet(pushbulletapi)
try:
mydevice = pb.get_device(device)
except:
mydevice = None
push = pb.push_note(
"Container: {}".format(wastetype),
"Container: {}\nDate: {}".format(wastetype, pickupdate),
device=mydevice)
zipcode = '3564KV'
number = 13
pushbulletapi = 'pushbullet_api_key'
pushbulletdevice = 'LGE Nexus 5X'
garbage = Afvalwijzer(zipcode, number)
pickupdate, wastetype = garbage.garbage
notify = garbage.notify
if notify and pushbulletapi:
notification(pushbulletdevice)
This script can now be set up as a cronjob on your server or alike.
.. code:: bash
0 6 * * * cd /path/to/script/notify_garbage.py > /dev/null 2>&1
.. |Wheel Status| image:: https://img.shields.io/pypi/wheel/afvalwijzer.svg :target: https://pypi.python.org/pypi/afvalwijzer .. |Python versions| image:: https://img.shields.io/pypi/pyversions/afvalwijzer.svg :target: https://pypi.python.org/pypi/afvalwijzer .. |PyPi Status| image:: https://img.shields.io/pypi/v/afvalwijzer.svg :target: https://pypi.python.org/pypi/afvalwijzer .. |Build Status| image:: https://travis-ci.org/bambam82/afvalwijzer.svg?branch=master :target: https://travis-ci.org/bambam82/afvalwijzer .. |Coverage Status| image:: https://coveralls.io/repos/github/bambam82/afvalwijzer/badge.svg?branch=master :target: https://coveralls.io/github/bambam82/afvalwijzer?branch=master
.. :changelog:
0.2.7 (2018-01-01) ++++++++++++++++++
0.2.6 (2017-12-31) ++++++++++++++++++
0.2.5 (2017-12-28) ++++++++++++++++++
Python packaging <https://python-packaging.readthedocs.io>
__0.2.4 (2017-12-27) ++++++++++++++++++
python setup.py checkdocs
; require pygments and collective.checkdocs0.2.1 (2017-12-26) ++++++++++++++++++
0.2 (2017-12-25) ++++++++++++++++
0.1 (2017-08-24) ++++++++++++++++ Initial release
FAQs
Getting the waste date and type for the Netherlands
We found that afvalwijzer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.