Skip to main content

Getting the waste date and type for the Netherlands

Project description

# Afvalwijzer library
[![Build Status](]([![Coveralls github](]([![PyPI version](]([![Wheel](]([![Python versions](](

This library is meant to interface with

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.

## Installation
# using pip or pip3
pip install afvalwijzer

## Uninstallation
# using pip or pip3
pip uninstall afvalwijzer

## Usage
>>> from Afvalwijzer import Afvalwijzer
>>> zipcode = '3564KV'
>>> number = '13'
>>> garbage = Afvalwijzer.Afvalwijzer(zipcode, number)

>>> garbage.pickupdate

>>> garbage.wastetype
'Groente-, Fruit- en Tuinafval'

>>> garbage.garbage
('2017-12-27', 'Groente-, Fruit- en Tuinafval')

The following function only returns true if the pickup date is the same as today.
>>> garbage.notify

Below is shown how I use it to get notified using pushbullet.
#!/usr/bin/env python3

from Afvalwijzer import Afvalwijzer
from pushbullet import Pushbullet

def notification(device=None):
pb = Pushbullet(pushbulletapi)
mydevice = pb.get_device(device)
mydevice = None
push = pb.push_note(
"Container: {}".format(wastetype),
"Container: {}\nDate: {}".format(wastetype, pickupdate),

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:

## Cron job
This script can now be set up as a cronjob on your server or alike.

0 6 * * * cd /path/to/script/ > /dev/null 2>&1

## Caveat
* Output is provided in Dutch due to the main website. There is a button for English, but I haven't got it working (yet).

## Contributors are most welcome
I'm still learning how to work with it all. Therefore feedback, advice, pull request etc. are most welcome.

# Release History

### 0.2 (2017-08-25)
* Status Beta
* Versioning in sync, setup reads it from the program
* History (this file) added
* Property decorators instead of traditional getters
* README improved

### 0.1 (2017-08-24)
**Initial release**

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
afvalwijzer-0.2-py2.py3-none-any.whl (6.2 kB) Copy SHA256 hash SHA256 Wheel py2.py3
afvalwijzer-0.2.tar.gz (4.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page