|
1 |
| -# Notubiz |
| 1 | +# Python client for NotuBiz |
| 2 | +This is an unofficial python client for NotuBiz. [NotuBiz](https://www.notubiz.nl/) is a Dutch council information system. |
| 3 | +I am not affiliated with NotuBiz in any way. |
2 | 4 |
|
3 | 5 | ## Requirements
|
4 |
| -Python >= 3.9 |
| 6 | +The package has been tested with Python 3.9, 3.10, and 3.11. |
| 7 | +First, create a new virtual environment, source into it, and install the dependencies. |
5 | 8 |
|
6 |
| -`py -m venv .venv` |
7 |
| -`pip install pip-compile-multi` |
| 9 | +``` |
| 10 | +python -m venv .venv |
| 11 | +source .venv/bin/activate |
| 12 | +pip install -r ./requirements.in |
| 13 | +``` |
8 | 14 |
|
9 |
| -## Installation |
10 |
| -First run |
11 |
| -`pip-compile '.\requirements.in'` |
12 |
| -to generate `requirements.txt`. |
| 15 | +## Usage |
| 16 | +Import the `ApiClient` and `Configuration` and provide the configuration with an organisation ID. |
| 17 | +This ID can be found [here](https://api.notubiz.nl/organisations). |
13 | 18 |
|
14 |
| -Then run `.\.venv\Scripts\Activate.ps1` |
15 |
| -In venv run `py -m pip install -r .\requirements.txt` |
| 19 | +```python |
| 20 | +from notubiz import ApiClient, Configuration |
16 | 21 |
|
17 |
| -`python setup.py install --user` |
| 22 | +configuration = Configuration(organisation_id = 686) # Gemeente Eindhoven |
| 23 | + |
| 24 | +api_client = ApiClient(configuration) |
| 25 | +``` |
| 26 | + |
| 27 | +Now that you have configured the API client, we can pass the API client to the various clients that are provided. |
| 28 | +Below, you can find an example for the `MeetingClient`. |
| 29 | +We retrieve a meeting with ID `1147925` and iterate over all agenda items in that meeting to print them. |
| 30 | + |
| 31 | +```python |
| 32 | +from notubiz.api.clients.meeting_client import MeetingClient |
| 33 | +meeting_client = MeetingClient(api_client) |
| 34 | + |
| 35 | +meeting = meeting_client.get(1147925) |
| 36 | + |
| 37 | +print(meeting.title) |
| 38 | +for agenda_item in meeting.agenda_items: |
| 39 | + print(" {} - {}".format(agenda_item.start_date, agenda_item.title)) |
| 40 | + |
| 41 | + for sub_agenda_item in agenda_item.agenda_items: |
| 42 | + print(" - {}".format(sub_agenda_item.title)) |
| 43 | +``` |
| 44 | + |
| 45 | +Next to the `MeetingClient`, we also have `EventsClient` and `SpeakersClient`. |
| 46 | +Examples for these clients can be found in the examples folder. |
0 commit comments