Download, parse and analyse votes in the german federal parliament, aka 'Bundestag'
Project description
"Namentliche Abstimmungen" in the Bundestag
How do individual members of the federal German parliament (Bundestag) vote in "Namentliche Abstimmungen" (roll call votes)? How does the individual align with the different political parties? And how may the members vote on upcoming bills? The
bundestagcli provides tools to assist to answer those questions by providing tools download and transform the required data.
Data sources
The German parliament makes roll call votes available as XLSX / XLS files (and PDFs ¯\_(ツ)_/¯ ) here: https://www.bundestag.de/parlament/plenum/abstimmung/liste.
The NGO abgeordnetenwatch provides an open API for a variety of related data. They also provide a great way of inspecting the voting behavior of members of parliament and their (non-)responses to question asked by the public.
Analyses in this repo
"Fraktionszwang"
Do all the members of a party always follow the party line? Clearly not. But that "discipline" is similar across parties. The significant deviation are the factionless, as measured here using Shannon entropy. The curious mind could even estimate the energy it takes to enforce the disciplines.
Embedded members of parliament
As a side effect of trying to predict the vote of individual members of parliament, we can obtain embeddings for each member. Doing so for the 2017-2021 legislative period, we find that they cluster into governing coalition (CDU/CSU & SPD) and the opposition:
If you want to see more check out this site or this notebook.
How to install
git clone https://github.com/eschmidt42/bundestag
cd bundestag
make install-dev-env
How to use
The bundestag cli
A tool to assist with the data processing.
To get preprocessed data simply run
uv run bundestag download huggingface
For an overview over commands run
uv run bundestag --help
To download data from abgeordnetenwatch, for a specific legislature id
uv run bundestag download abgeordnetenwatch 132
To transform the downloaded data run
uv run bundestag transform abgeordnetenwatch 132
To find out the legislature id for the current Bundestag, visit abgeordnetenwatch.de and click on the "Open Data" button at the bottom of the page.
To download data from bundestag.de
uv run bundestag download bundestag-sheets --do-create-xlsx-uris-json
To transform the downloaded data run
uv run bundestag transform bundestag-sheet --sheet-source=json_file
Note: If you run uv run bundestag transform abgeordnetenwatch 132 the data is damaged for some reason. To fix it run uv run python scripts/fix_empty_fraction.py
The get_xlsx_uris cli
Pre-processing cli for bundestag cli.
uv run get_xlsx_uris run --help
Module for collecting and storing XLSX URIs from Bundestag data sources. Also done with
uv run bundestag download bundestag_sheet --do-create-xlsx-uris-json
Jupyter notebooks
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bundestag-0.1.3a0.tar.gz.
File metadata
- Download URL: bundestag-0.1.3a0.tar.gz
- Upload date:
- Size: 10.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58c97ad6a0e1e5dfebb7111c51dc8e9b29febf157461eabaf151efa8f34a51d1
|
|
| MD5 |
aecc10c3bb2c1a01e9c0537c9929a84b
|
|
| BLAKE2b-256 |
f89fed19a7739e89177acf8f23b97f68500939e5e54568cf95375c38a536517e
|
Provenance
The following attestation bundles were made for bundestag-0.1.3a0.tar.gz:
Publisher:
publish.yml on eschmidt42/bundestag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bundestag-0.1.3a0.tar.gz -
Subject digest:
58c97ad6a0e1e5dfebb7111c51dc8e9b29febf157461eabaf151efa8f34a51d1 - Sigstore transparency entry: 495430766
- Sigstore integration time:
-
Permalink:
eschmidt42/bundestag@ebf46e8c6b2dc23cabf7c7fef4c923ccab1c254d -
Branch / Tag:
refs/tags/v0.1.3a0 - Owner: https://github.com/eschmidt42
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ebf46e8c6b2dc23cabf7c7fef4c923ccab1c254d -
Trigger Event:
push
-
Statement type:
File details
Details for the file bundestag-0.1.3a0-py3-none-any.whl.
File metadata
- Download URL: bundestag-0.1.3a0-py3-none-any.whl
- Upload date:
- Size: 43.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30ae31c6fe509b21ba13bebe631a9968074f8cd73f8bcb95cf3d185668fd56dc
|
|
| MD5 |
5b51432bc3fe6c098318ec1a0c1fe8a4
|
|
| BLAKE2b-256 |
f57522e5d5a8e0afdd184a05f369f1489023a445aed4ff837f788cfc98598628
|
Provenance
The following attestation bundles were made for bundestag-0.1.3a0-py3-none-any.whl:
Publisher:
publish.yml on eschmidt42/bundestag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bundestag-0.1.3a0-py3-none-any.whl -
Subject digest:
30ae31c6fe509b21ba13bebe631a9968074f8cd73f8bcb95cf3d185668fd56dc - Sigstore transparency entry: 495430779
- Sigstore integration time:
-
Permalink:
eschmidt42/bundestag@ebf46e8c6b2dc23cabf7c7fef4c923ccab1c254d -
Branch / Tag:
refs/tags/v0.1.3a0 - Owner: https://github.com/eschmidt42
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ebf46e8c6b2dc23cabf7c7fef4c923ccab1c254d -
Trigger Event:
push
-
Statement type: