Metadata-Version: 2.1
Name: tkdocs
Version: 0.0.5
Summary: Download and parse parliamentary documents from the Dutch Lower House website
Author-email: dirkmjk <info@dirkmjk.nl>
Project-URL: Homepage, https://github.com/DIRKMJK/tkdocs
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: python-dateutil
Requires-Dist: pandas
Requires-Dist: requests
Requires-Dist: bs4

Search for official documents of the Dutch Lower House (Tweede Kamer) and extract relevant data.

Note that this is work in progress. The package may not work properly. Currently only queries for motions (moties) and amendments (amendementen) are supported.

# Installation

`pip install tkdocs`

# Simple example

```python
from tkdocs import query_tk

data = {
    'query': 'referentiewaarden,minimumloon',
    'fromdate': '2017-03-15',
    'todate': '2023-01-01',
    'operator': 'and',
    'doc_type': 'motie',
    'dir_results': '../data/wml',
    'download_files': True
}

query_tk(**data)
```

This will search for motions with search query `referentiewaarden AND minimumloon`, between 15 March 2017 and 1 January 2023.

Results will be stored as an excel file containing data including date, title, who sponsored the motion, and how parties voted (`../data/wml/results.xlsx`; make sure `dir_results` points to a location where the results can be stored). Since `download_files` was set to `True`, the pdf’s containing the motion text will be downloaded as well, and stored in `../data/wml/files`.

Als long as you don’t change `dir_results`, results will be merged if you do multiple queries.

For all options, see `help(query_tk)`.
