Python bindings and ORM for the Tweede Kamer OData API
Project description
tkapi
Python ORM and bindings for the Tweede Kamer Open Data Portaal OData API.
A pure Python interface for the Tweede Kamer API with type annotations for easy data model discovery.
Requires Python 3.5+.
Please create an issue if you have any problems, questions or suggestions.
Installation
pip install tkapi
Data model
See Open Kamer Data Model documentation for the data model that is mapped to Python classes.
Usage
A simple first example,
import tkapi
api = tkapi.TKApi()
personen = api.get_personen(max_items=100)
for persoon in personen:
print(persoon.achternaam)
For more examples see the examples and tests.
Entities
See Tweede Kamer documentation for details.
Algemeen | Persoon | Fractie | Commissie |
---|---|---|---|
Activiteit | Persoon | Fractie | Commissie |
ActiviteitActor | PersoonContactinformatie | FractieAanvullendGegeven | CommissieContactinformatie |
Agendapunt | PersoonFunctie | FractieZetel | CommissieZetel |
Besluit | PersoonGeschenk | FractieZetelPersoon | CommissieZetelVastPersoon |
Document | PersoonLoopbaan | FractieZetelVacature | CommissieZetelVastVacature |
DocumentActor | PersoonNevenfunctie | CommissieZetelVervangerPersoon | |
DocumentVersie | PersoonNevenfunctieInkomsten | CommissieZetelVervangerVacature | |
Kamerstukdossier | PersoonOnderwijs | ||
Reservering | PersoonReis | ||
Stemming | |||
Vergadering | |||
Verslag | |||
Zaak | |||
ZaakActor | |||
Zaal |
Development
Tests
Run all tests,
python -m unittest discover
Coverage report
Run all tests,
coverage run -m unittest discover
Create coverage report,
coverage html
Then visit htmlcov/index.html in your browser.
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
File details
Details for the file tkapi-0.9.8.tar.gz
.
File metadata
- Download URL: tkapi-0.9.8.tar.gz
- Upload date:
- Size: 35.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13a18b58eb95e3bb4026a3e2f69e22890e75f323cbf4bc43e9c9f1f24d1d1ef1 |
|
MD5 | 2b9920834d2b164f9d0bf44e752e8627 |
|
BLAKE2b-256 | 887ad00091455118940b7edefc30905cc559ca26f650f82a1b7b4c8080cdb017 |
File details
Details for the file tkapi-0.9.8-py3-none-any.whl
.
File metadata
- Download URL: tkapi-0.9.8-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0144c20581653f9551c33491e45b49c604486636cec62c4061a48d1cc89743f5 |
|
MD5 | 3de046a1103d987b1352f5fd5ddbd8f2 |
|
BLAKE2b-256 | 9924232450dbe5568b4f5433cfad2f3d07ca87a3e0834fef12efa23589ba4679 |