- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Remove GitHub remote (contained embedded PAT) - Add deploy/nginx-wahlprognose.conf and deploy/gunicorn-wahlprognose.service - Update README with deployment docs and local dev instructions - Add data/*.db to .gitignore, untrack data/wahlprognosen.db (runtime data) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
| apache-conf | ||
| deploy | ||
| .gitignore | ||
| app.py | ||
| get_data_to_db.py | ||
| LICENSE | ||
| README.md | ||
| utilities.py | ||
| wsgi.py | ||
Wahlprognosen Deutschland — Sonntagsfrage Visualisierung
Basierend auf der Sonntagsfragenanalyse von D. Kriesel — interaktive Dash-Visualisierung der deutschen Sonntagsfrage-Umfragen. Die App scrapt Umfragedaten von wahlrecht.de, speichert sie in einer lokalen SQLite-Datenbank und zeigt interaktive Zeitreihen pro Partei und Institut.
Features
- Zeitreihen der Sonntagsfrage pro Partei
- Institut-Vergleich und -Filterung (ein-/ausblendbar)
- Gleitender Durchschnitt (einstellbarer Zeitraum per Slider)
- Zeitraum-Buttons (3M / 6M / 1J / 2J / Gesamt)
- Linked Zoom: oberer und unterer Plot synchronisiert via Session Storage
Tech Stack
- Python 3, Dash, Plotly, scipy, pandas, SQLite, BeautifulSoup
- Deployment: gunicorn + nginx Reverse Proxy
- URL: https://wahlprognose.nerd-department.de
Datenquelle
Umfragedaten werden von wahlrecht.de gescrapt und lokal in einer SQLite-Datenbank (data/wahlprognosen.db) gespeichert. Die Datenbankdatei ist nicht im Repository (Runtime-Daten, per .gitignore ausgeschlossen) und muss lokal befüllt werden.
Lokale Entwicklung
python -m venv .venv
source .venv/bin/activate
pip install dash plotly pandas scipy beautifulsoup4 requests
# Datenbank initial befüllen (scrapt wahlrecht.de)
python get_data_to_db.py
# App starten
python app.py
Die App ist dann unter http://127.0.0.1:8050 erreichbar.
Deployment
Die App läuft als gunicorn-Prozess hinter nginx auf Port 5002.
WorkingDirectory: /var/www/html/wahlprognose/
wsgi.py importiert server aus app.py als application.
Konfigurationsdateien im deploy/-Verzeichnis:
| Datei | Zweck |
|---|---|
deploy/nginx-wahlprognose.conf |
nginx-vhost (HTTPS, Proxy auf Port 5002) |
deploy/gunicorn-wahlprognose.service |
systemd-Service |
Update/Neustart
rsync -a . /var/www/html/wahlprognose/ --exclude='.git' --exclude='data/*.db'
systemctl restart gunicorn-wahlprognose