Async client library for the BIR Trash Collection API
Project description
birtrashclient
Async Python client for the BIR Trash Collection API.
Installation
pip install birtrashclient
Usage
import asyncio
from birtrashclient import BirTrashClient
async def main():
client = BirTrashClient(app_id="your_app_id", contractor_id="your_contractor_id")
await client.authenticate()
address_id = await client.search_address("Storgata 1, Bergen")
calendar = await client.get_calendar(address_id, "2024-01-01", "2024-12-31")
for entry in calendar:
print(entry)
await client.close()
asyncio.run(main())
API
BirTrashClient(app_id, contractor_id, ...)
| Parameter | Type | Default | Description |
|---|---|---|---|
app_id |
str |
required | Application ID for API authentication |
contractor_id |
str |
required | Contractor ID for API authentication |
request_timeout |
int |
10 |
HTTP timeout in seconds |
session |
aiohttp.ClientSession |
None |
Optional session to reuse |
retries |
int |
3 |
Retries on transient server errors |
backoff_factor |
float |
2.0 |
Exponential backoff base multiplier |
Methods
authenticate()— Fetch and store an auth tokensearch_address(address)— Resolve a street address to a property IDget_calendar(address_id, from_date, to_date)— Get pickup schedule (dates asYYYY-MM-DD)close()— Close the underlying HTTP session
Exceptions
BirTrashAuthError— Authentication failureBirTrashConnectionError— Connection or HTTP error after retries
License
MIT
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 birtrashclient-0.1.4.tar.gz.
File metadata
- Download URL: birtrashclient-0.1.4.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
072d936b848361ada6a319323b1c6752c1d7917914483d581afcaaf8433e85bf
|
|
| MD5 |
a85a22240c0253445a0260c343c6ec8d
|
|
| BLAKE2b-256 |
8044846feb6e2c1ea1d9de6d6836a1fbcb18d616e34f85f64c7e61c1083f2ad4
|
Provenance
The following attestation bundles were made for birtrashclient-0.1.4.tar.gz:
Publisher:
workflow.yml on eirikgrindevoll/birtrashclient
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
birtrashclient-0.1.4.tar.gz -
Subject digest:
072d936b848361ada6a319323b1c6752c1d7917914483d581afcaaf8433e85bf - Sigstore transparency entry: 1006554469
- Sigstore integration time:
-
Permalink:
eirikgrindevoll/birtrashclient@cb24996e9fa03178c69a693eb59400f906ccf6cc -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/eirikgrindevoll
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@cb24996e9fa03178c69a693eb59400f906ccf6cc -
Trigger Event:
release
-
Statement type:
File details
Details for the file birtrashclient-0.1.4-py3-none-any.whl.
File metadata
- Download URL: birtrashclient-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.9 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 |
303737532d7af478069bc8495804672fd395952829b8a91f6c256a4da6fbbe54
|
|
| MD5 |
9d4b9b69298cf32061a394b0e6f47060
|
|
| BLAKE2b-256 |
375c451d91fdb45f52d1bd09209b26aa8e5fccd575ee6f1e9579d74a4c506ecf
|
Provenance
The following attestation bundles were made for birtrashclient-0.1.4-py3-none-any.whl:
Publisher:
workflow.yml on eirikgrindevoll/birtrashclient
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
birtrashclient-0.1.4-py3-none-any.whl -
Subject digest:
303737532d7af478069bc8495804672fd395952829b8a91f6c256a4da6fbbe54 - Sigstore transparency entry: 1006554471
- Sigstore integration time:
-
Permalink:
eirikgrindevoll/birtrashclient@cb24996e9fa03178c69a693eb59400f906ccf6cc -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/eirikgrindevoll
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@cb24996e9fa03178c69a693eb59400f906ccf6cc -
Trigger Event:
release
-
Statement type: