This repository contains data we’re collecting for Op wie kan ik stemmen? and the scripts used to scrape and merge the data.
The main files are:
kandidaten.json, the complete list of candidates for 2025 based on the procesverbaal, with the 2021 and 2023 election info addedpartijen.json, the complete list of parties of the past three Tweede Kamerverkiezingen
Additionally, there are the following folders:
./partijwebsite-lijstencontains a json with candidate info copied from their party websites (but not yet the info from the individual’s pages, even if the exist)./kiesraadcontains kiesraad files (e.g. a procesverbaal pdf and definitive candidate list csv) and scripts to turn them into json files
- Switch to the kiesraad folder and activate the virtual environment
cd data && . venv/bin/activate - Parse the Kiesraad CSV into our JSON format
python3 scrape_kiesraad_csv.py -f kiesraad2025.csv -e tk2025 - Add the previous election lists
python3 merge.py -t kandidaten.json -s definitief2021.json - Copy the
kandidaten.jsonto the main foldercp kandidaten.json ../kandidaten.json - Update the info in
kadasterwith the scripts there - Add the kadaster info from the data folder
cd ../ && python3 add_gemeente_info.py -t kandidaten.json -c kadaster/combi_gemeentes.json -g kadaster/kandidaat-gemeente.json - Add party list info
python3 add_partywebsite_data.py -t kandidaten.json -p partijen.json -f partijwebsite-lijsten
Using electiontool, create a csv-file based on the EML-files.
For example:
- Download the counting files from tk2025 ('Digitale tellingsbestanden hoofdstembureaus')
- Unzip the file
- Clone the electiontool repository
git clone https://github.com/kroncrv/electiontool.git - Install the dependencies (e.g.
pip install dataknead xmltodict dpathor following their README) - Copy the path to the
Kieskring tellingenfolder - Run python3
./electiontool.py -i <path to tellingen> -o <desired filename> --output-structure candidates --add-percentages(e.g.python3 ./electiontool.py -i ./tellingen -o tk2025.csv --output-structure candidates --add-percentages) - Copy the output csv to this folder
- Run
python3 merge_vote_csv.py -s tk2025.csv