Async Python client for the BIR waste collection API
Project description
pybirno
Async Python client for the BIR waste collection API. BIR handles garbage collection in the Bergen region of Norway. This library wraps a small part of their API (address lookup, auth, and pickup schedules) and was made to power the Home Assistant BIR integration.
Installation
pip install pybirno
Usage
Fetching pickups
import asyncio
from aiohttp import ClientSession
from pybirno import BirClient
async def main():
async with ClientSession() as session:
client = BirClient("property-id", session)
pickups = await client.get_pickups()
for pickup in pickups:
print(f"{pickup.waste_type}: {pickup.date}")
asyncio.run(main())
Searching for addresses
Find your property ID by searching for an address:
async def find_address():
async with ClientSession() as session:
addresses = await BirClient.search_addresses(session, "Testveien 1")
for addr in addresses:
print(f"{addr.address} (ID: {addr.property_id})")
Error handling
from pybirno import BirClient, BirAuthenticationError, BirConnectionError
async def safe_fetch():
async with ClientSession() as session:
client = BirClient("property-id", session)
try:
pickups = await client.get_pickups()
except BirAuthenticationError:
print("Authentication failed")
except BirConnectionError:
print("Could not reach BIR API")
API Documentation
Contributing
See CONTRIBUTING.md for development setup and guidelines.
Security
See SECURITY.md for reporting vulnerabilities.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pybirno-0.2.0.tar.gz.
File metadata
- Download URL: pybirno-0.2.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfb19dde240828fd16f478ad2cc89e9b3019b2e7eaf6633daa7c42b37040bc91
|
|
| MD5 |
b102af72ab158c7f0cd1b8eac4a03008
|
|
| BLAKE2b-256 |
8ea728051681f974bd3fcab4a20cfc6ab83634a253f95e8e428c2eb938b5cf5f
|
Provenance
The following attestation bundles were made for pybirno-0.2.0.tar.gz:
Publisher:
publish.yml on SanderBlom/pybirno
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pybirno-0.2.0.tar.gz -
Subject digest:
dfb19dde240828fd16f478ad2cc89e9b3019b2e7eaf6633daa7c42b37040bc91 - Sigstore transparency entry: 1206446325
- Sigstore integration time:
-
Permalink:
SanderBlom/pybirno@e27b5111339f4118f12ebf3eda998f7ea6a724ba -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/SanderBlom
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e27b5111339f4118f12ebf3eda998f7ea6a724ba -
Trigger Event:
release
-
Statement type:
File details
Details for the file pybirno-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pybirno-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdf6c3c7950347436c01e9ff3b0897681a13aac2ceba39a1a91415f865d3f26f
|
|
| MD5 |
d5a4610b5276bf9f20535736c5671c49
|
|
| BLAKE2b-256 |
b2dd3d28c417c357c80b39e2666c41a9964ce71bea555eea897dea186f51441d
|
Provenance
The following attestation bundles were made for pybirno-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on SanderBlom/pybirno
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pybirno-0.2.0-py3-none-any.whl -
Subject digest:
cdf6c3c7950347436c01e9ff3b0897681a13aac2ceba39a1a91415f865d3f26f - Sigstore transparency entry: 1206446337
- Sigstore integration time:
-
Permalink:
SanderBlom/pybirno@e27b5111339f4118f12ebf3eda998f7ea6a724ba -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/SanderBlom
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e27b5111339f4118f12ebf3eda998f7ea6a724ba -
Trigger Event:
release
-
Statement type: