/wahlen

Learning python by exploring Germany's 2017 election results

Primary LanguagePython

Wahlen

Learning python by exploring Germany's 2017 election results.

Usage

The python script produces the output of some of the steps involved in the allocation of seats in the Bundestag. Available output:

Second votes (Zweitstimmen):

python wahl.py second_votes # generates _second_votes.csv

python wahl.py second_votes_chart # opens up a bar chart in a new window

Display a chart of second vote percentages across parties in Germany:

python wahl.py second_votes_chart

Direct seats and list seats (Direktmandat, Listenmandat and Überhang):

python wahl.py direct_list_seats # generates _direct_list_seats.csv

Bundestag Seat Distribution:

python wahl.py bundestag_seats # generates _bundestag_seats.csv

Candidates elected to the Bundestag:

This takes about 1-2 minutes to complete on my macbook pro 2016 as it crawls the election site to extract the elected candidates.

python wahl.py elected_candidates # generates _elected_candidates.csv

Display a map of directly elected candidates to the Bundestag:

This takes about 1-2 minutes to complete on my macbook pro 2016 as it crawls the election site to extract the elected candidates.

python wahl.py directly_elected_candidates_map

Tests

Tests are written using doctest.