SSAM Waste Schedule Library
A simple library for the SSAM Waste Schedule API written in Python 3.
SSAM (Södra Smålands Avfall & Miljö) is a Swedish Waste Management company. They empty their customers trash bins on a pre-defined schedule. This library will fetch the schedule from their API and present it to the user through a few simple classes and properties, wrapped inside a Python package.
Installation
Install the latest version with pip3:
$ pip3 install ssamwaste
Basics
Building ID
Every household has a building ID attached to it. This ID is what's used to query the API for the schedule associated with an address.
If it's the first time you are using this library and you don't know the building ID of your address you must start by finding out your building ID:
from ssam import ssam
ssam = ssam.WasteScheduler()
buildings = ssam.search_building('Storgatan 1')
# The search results are returned in a list
for building in buildings:
print(building)
You can access the address, city and building ID as properties on a building object, like this:
>>> building.address
'Storgatan 1'
>>> building.city
'Storstaden'
>>> building.id
'71337'
Schedule
from ssam import ssam
ssam = ssam.WasteScheduler()
# The get_waste_bins() method require a Building ID. It returns a list of WasteBin objects.
for waste_bin in ssam.get_waste_bins(12345):
print(waste_bin)
You can access the properties of the WasteBin object, like this:
>>> bin.next_waste_pickup
'2021-04-23'
>>> bin.waste_pickups_per_year
26
>>> bin.waste_type
'Hushållsavfall'
>>> bin.waste_pickup_frequency
'Tömning varannan vecka fredag jämn vecka helår'
>>> bin.bin_code
'K180'
>>> bin.bin_size
180.0
>>> bin.bin_unit
'l'
>>> bin.bin_container_type
'Kärl'
>>> bin.number_of_bins
1.0
>>> bin.is_active
True
>>> bin.id
123456
>>> bin.description
'Kärl 180 l 14-dagarstömning'
>>> bin.building_id
12345
Metadata
Release files for ssamwaste 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ssamwaste-1.0.1.tar.gz | 5.0 kB | Without provenance | Details for ssamwaste-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ssamwaste-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for ssamwaste-1.0.1-py3-none-any.whl |
Total release size: 10.4 kB
Release files / ssamwaste-1.0.1.tar.gz
| Download URL | ssamwaste-1.0.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27e995d5b4f7c0af19da22d4b8d4e3c4bf4bde01887ae8ffe18fafcbc3f1d87e
|
|
BLAKE2b-256 checksum How to use checksums |
51a3eb4884452d7dd19b1e79ba090498cec2d27879cce1d5ad70aa1a0ca511fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.4
|
Release files / ssamwaste-1.0.1-py3-none-any.whl
| Download URL | ssamwaste-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bca7c9fd0b2cb562226eda0e5bbe2ea0e367ede7c22a9ab22fda4da9a3852694
|
|
BLAKE2b-256 checksum How to use checksums |
02c07e958a83767d2fe00501dab287b76d966fa393a2afc1debb5f48228cd939
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.4
|
Security for ssamwaste 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.