Skip to main content

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 bundestag cli provides tools to assist to answer those questions by providing tools download and transform the required data.

Binder Tests codecov

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.

median rolling entropy over time

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: 2d display of mandate embeddings

surprised pikachu

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bundestag-0.1.3a0.tar.gz (10.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bundestag-0.1.3a0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

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

Hashes for bundestag-0.1.3a0.tar.gz
Algorithm Hash digest
SHA256 58c97ad6a0e1e5dfebb7111c51dc8e9b29febf157461eabaf151efa8f34a51d1
MD5 aecc10c3bb2c1a01e9c0537c9929a84b
BLAKE2b-256 f89fed19a7739e89177acf8f23b97f68500939e5e54568cf95375c38a536517e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bundestag-0.1.3a0.tar.gz:

Publisher: publish.yml on eschmidt42/bundestag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for bundestag-0.1.3a0-py3-none-any.whl
Algorithm Hash digest
SHA256 30ae31c6fe509b21ba13bebe631a9968074f8cd73f8bcb95cf3d185668fd56dc
MD5 5b51432bc3fe6c098318ec1a0c1fe8a4
BLAKE2b-256 f57522e5d5a8e0afdd184a05f369f1489023a445aed4ff837f788cfc98598628

See more details on using hashes here.

Provenance

The following attestation bundles were made for bundestag-0.1.3a0-py3-none-any.whl:

Publisher: publish.yml on eschmidt42/bundestag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page