Name | BundestagsAPy JSON |
Version |
1.4
JSON |
| download |
home_page | None |
Summary | Python Wrapper for the Bundestags API |
upload_time | 2024-08-06 18:22:00 |
maintainer | None |
docs_url | None |
author | Paul Bose |
requires_python | None |
license | None |
keywords |
bundestag
api
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# BundestagsAPy: A python wrapper for the Bundestags DIP API.
## Installation
The easiest way to install the latest stable version from PyPI is by using pip:
```
pip install bundestagsapy
```
Alternatively, install directly from the GitHub repository:
```
pip install git+https://github.com/parobo/BundestagsAPy
```
## Usage
To use the API wrapper, simply call the client object with your API key.
See https://dip.bundestag.de/%C3%BCber-dip/hilfe/api#content on how to get an API key.
### Initialization
```Python
import BundestagsAPy
api_key='XXXXXXXXXXXXXXX'
client = BundestagsAPy.Client(api_key)
```
### Endpoints
The client provides access to all available documents through methods named after the endpoints (`bt_{endpoint}`). E.g.
```Python
client.bt_aktivitaet(max_results=50, id, start_date, end_date, updated_start, updated_end, drucksache, plenaeprotokoll, zuordnung)
```
The available endpoint are:
- aktivitaet: `bt_aktivitaet()`
- drucksache: `bt_drucksache()`
- drucksache-text: `bt_drucksache_text()`
- person: `bt_person()`
- plenarprotokoll: `bt_plenarprotokoll()`
- plenarprotokoll-text: `bt_plenarprotokoll_text()`
- vorgang: `bt_vorgang()`
- vorgangsposition: `bt_vorgangsposition()`
All methods accept `max_results` as input. It takes either an interger as value, in which case the method returns the first `max_results` supplied by the API, or `False`, in which case all available documents are returned. Note that because of the API infrastructure, at least 50 results are always returned.
`id` can either be an integer (for single document returned) or a list of integers (for multiple).
Most endpoints accept the parameters `start_date` and `end_date`, which should be in strings in the format YYYY-mm-dd. Some deviation is allowed, the client tries to parse the date using dateutil and then formats it however necessary for the API.
The client now also accept the parameters `updated_start` and `updated_end`, which should be in strings in the format YYYY-mm-ddTHH:MM:SS+ZZ:ZZ. Some deviation is allowed, the client tries to parse the date using dateutil and then formats it however necessary for the API. Default time zone is +02:00.
see https://dip.bundestag.de/documents/informationsblatt_zur_dip_api.pdf for details on other acceptable parameters for each endpoint.
For more information on available endpoints and allowed parameters, see also https://search.dip.bundestag.de/api/v1/swagger-ui/.
### Results
The results from each request to an endpoint is an object named after the document requested if a single document was requested. Each object has as its attributes all the available data named in the same way as documented on https://dip.bundestag.de/documents/informationsblatt_zur_dip_api.pdf.
If multiple documents were requested, BundestagsAPy returns a list of the documents. E.g.
```Python
for result in client.bt_aktivitaet(max_results=False, start_date='2020-01-01',end_date='2020-01-02'):
print(result.id,result.titel)
for result in client.bt_drucksache(max_results=False, updated_start='2022-01-01T00:00:00+02:00',updated_end='2023-02-01T00:00:00+02:00'):
print(result.id,result.titel)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "BundestagsAPy",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Bundestag, API",
"author": "Paul Bose",
"author_email": "<bose@ese.eur.nl>",
"download_url": "https://files.pythonhosted.org/packages/2b/73/50774a4a5481d4d6983d5c485b5fef89607567ba96440f81531f625ed837/BundestagsAPy-1.4.tar.gz",
"platform": null,
"description": "# BundestagsAPy: A python wrapper for the Bundestags DIP API.\n## Installation\nThe easiest way to install the latest stable version from PyPI is by using pip:\n\n```\npip install bundestagsapy\n```\nAlternatively, install directly from the GitHub repository:\n\n```\npip install git+https://github.com/parobo/BundestagsAPy\n```\n\n## Usage\nTo use the API wrapper, simply call the client object with your API key.\nSee https://dip.bundestag.de/%C3%BCber-dip/hilfe/api#content on how to get an API key.\n\n### Initialization\n```Python\nimport BundestagsAPy\napi_key='XXXXXXXXXXXXXXX'\nclient = BundestagsAPy.Client(api_key)\n```\n### Endpoints\nThe client provides access to all available documents through methods named after the endpoints (`bt_{endpoint}`). E.g.\n```Python\nclient.bt_aktivitaet(max_results=50, id, start_date, end_date, updated_start, updated_end, drucksache, plenaeprotokoll, zuordnung)\n```\nThe available endpoint are:\n- aktivitaet: `bt_aktivitaet()`\n- drucksache: `bt_drucksache()`\n- drucksache-text: `bt_drucksache_text()`\n- person: `bt_person()`\n- plenarprotokoll: `bt_plenarprotokoll()`\n- plenarprotokoll-text: `bt_plenarprotokoll_text()`\n- vorgang: `bt_vorgang()`\n- vorgangsposition: `bt_vorgangsposition()`\n\nAll methods accept `max_results` as input. It takes either an interger as value, in which case the method returns the first `max_results` supplied by the API, or `False`, in which case all available documents are returned. Note that because of the API infrastructure, at least 50 results are always returned.\n\n`id` can either be an integer (for single document returned) or a list of integers (for multiple).\n\nMost endpoints accept the parameters `start_date` and `end_date`, which should be in strings in the format YYYY-mm-dd. Some deviation is allowed, the client tries to parse the date using dateutil and then formats it however necessary for the API.\n\nThe client now also accept the parameters `updated_start` and `updated_end`, which should be in strings in the format YYYY-mm-ddTHH:MM:SS+ZZ:ZZ. Some deviation is allowed, the client tries to parse the date using dateutil and then formats it however necessary for the API. Default time zone is +02:00. \n\nsee https://dip.bundestag.de/documents/informationsblatt_zur_dip_api.pdf for details on other acceptable parameters for each endpoint.\nFor more information on available endpoints and allowed parameters, see also https://search.dip.bundestag.de/api/v1/swagger-ui/.\n\n\n### Results\nThe results from each request to an endpoint is an object named after the document requested if a single document was requested. Each object has as its attributes all the available data named in the same way as documented on https://dip.bundestag.de/documents/informationsblatt_zur_dip_api.pdf.\n\nIf multiple documents were requested, BundestagsAPy returns a list of the documents. E.g.\n\n```Python\nfor result in client.bt_aktivitaet(max_results=False, start_date='2020-01-01',end_date='2020-01-02'):\n\tprint(result.id,result.titel)\n\nfor result in client.bt_drucksache(max_results=False, updated_start='2022-01-01T00:00:00+02:00',updated_end='2023-02-01T00:00:00+02:00'):\n\tprint(result.id,result.titel)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Python Wrapper for the Bundestags API",
"version": "1.4",
"project_urls": null,
"split_keywords": [
"bundestag",
" api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2b7350774a4a5481d4d6983d5c485b5fef89607567ba96440f81531f625ed837",
"md5": "1980cae0ac8f1aa8da339dbd916c69ea",
"sha256": "f07602c98e1d2f063d4244d2c612a164e0eeccbed353a86e0baea89e693fa788"
},
"downloads": -1,
"filename": "BundestagsAPy-1.4.tar.gz",
"has_sig": false,
"md5_digest": "1980cae0ac8f1aa8da339dbd916c69ea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7256,
"upload_time": "2024-08-06T18:22:00",
"upload_time_iso_8601": "2024-08-06T18:22:00.882076Z",
"url": "https://files.pythonhosted.org/packages/2b/73/50774a4a5481d4d6983d5c485b5fef89607567ba96440f81531f625ed837/BundestagsAPy-1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-06 18:22:00",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "bundestagsapy"
}