User hat die zweite ZIP geliefert: 'Scorecard Formate.html' mit Spec fuer drei zusaetzliche Formate. Plus Anmerkung: 'doppelte Borders' und 'Export viel zu gross'. Vier Formate jetzt im selben Template scorecard_portrait.html: - format=portrait (DEFAULT) → 1080×1350 · 4:5 · IG-Feed - format=square → 1080×1080 · 1:1 · IG/LinkedIn - format=story → 1080×1920 · 9:16 · Story/Reels - format=wide → 1920×1080 · 16:9 · OG/Slide/Twitter Wide hat 2-spaltigen Body-Aufbau (Story-Spalte links, Daten-Spalte rechts, Header+Footer ueber volle Breite), die anderen drei nutzen das gemeinsame 1-spaltige Body-Markup. Aller Formate teilen sich die Daten-Aggregation (Chips, Fraktions-Bars, Beschluss). Bug-Fixes aus dem User-Feedback: 1. 'Doppelte Borders um die Partei und Field-Chips' — die 1.5-px- Borders im Cloud-Design wurden von WeasyPrint als zwei einzelne 1-px-Linien gerendert (Subpixel-Bug bei fractional border-widths). Alle 1.5px → 2px (integer). 2. 'Export viel zu gross' — der Download-Button hatte scale=2 als Default → 2160×2700 PNG-Pixel. Fuer IG-Upload reicht 1080×1350 exakt (Instagram skaliert hochgeladene Bilder ohnehin). Default jetzt scale=1, der ?scale=2-Param bleibt verfuegbar fuer Retina. 3. Statusleiste mit Format-Switcher: vier Pills (4:5 Feed / 1:1 Square / 9:16 Story / 16:9 Wide), aktuelles Format hervorgehoben. Klick wechselt URL-format-Param. Plus PNG- und PDF-Download-Buttons, die das aktuelle Format mitfuehren. main.py: dimensions-Mapping um story+wide erweitert in scorecard_template UND _render_scorecard_pdf. Format-Validation ebenfalls erweitert. format-Variable an's Template durchgeschleift (damit der Template-Switch fuer card-portrait/square/story/wide funktioniert). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| app | ||
| docs | ||
| scripts | ||
| tests | ||
| .coveragerc | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .tarignore | ||
| CHANGELOG.md | ||
| DATA-LICENSE | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| mkdocs.yml | ||
| pytest.ini | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
GWÖ-Antragsprüfer
Automatische Gemeinwohl-Bilanzierung von Parlamentsanträgen nach der GWÖ-Matrix 2.0 für Gemeinden
Live unter https://gwoe.toppyr.de/.
Was macht das Tool?
Der GWÖ-Antragsprüfer analysiert Anträge aus deutschen Landesparlamenten und dem Bundestag und bewertet sie nach den Kriterien der Gemeinwohl-Ökonomie (GWÖ):
- GWÖ-Score (0–10) — Wie gut entspricht der Antrag den GWÖ-Werten?
- Matrix-Zuordnung — Welche der 25 Felder der GWÖ-Matrix für Gemeinden werden adressiert?
- Programm-Treue — Passt der Antrag zum Wahl- und Grundsatzprogramm jeder Fraktion?
- Verbesserungsvorschläge — Konkrete Textänderungen mit GWÖ-Begründung im Redline-Format
- Zitate mit Verifikation — Belege aus den Wahl-/Grundsatzprogrammen, server-seitig gegen Original-Chunks geprüft (siehe ADR 0001)
Aktive Datenquellen (Stand Release 1.0)
16 Bundesländer + Bundestag — alle aktiven Adapter:
| BL | Wahlperiode | Quelle |
|---|---|---|
| BUND | 21 (2025–2029) | bundestag.de DIP |
| BW | 17 (2021–2026) | PARLIS |
| BY | 19 (2023–2028) | Bayern Landtag |
| BE | 19 (2023–2026) | Berlin AGH |
| BB | 8 (2024–2029) | StarWeb |
| HB | 21 (2023–2027) | ParlDok |
| HH | 23 (2025–2029) | ParlDok |
| HE | 21 (2024–2029) | Hessen Landtag |
| MV | 8 (2021–2026) | ParlDok |
| NI | — | NILAS (login-protected, deferred) |
| NRW | 18 (2022–2027) | OPAL |
| RP | 18 (2021–2026) | StarWeb |
| LSA | 8 (2021–2026) | StarWeb |
| SL | 17 (2022–2027) | Umbraco |
| SN | 8 (2024–2029) | XML-Export |
| SH | 20 (2022–2027) | Schleswig-Holstein |
| TH | 8 (2024–2029) | StarWeb |
Plus abgeordnetenwatch.de-Integration für strukturierte namentliche Abstimmungen (alle 16 BL + BT).
Features
Frontend (v2, ECOnGOOD-CD)
- Listenansicht mit Score-Band-Filter, BL-Chip-Filter, Sort-Dropdown (8 Optionen), Live-Suche
- Antragsdetail mit ScoreHero, Matrix 5×5, Zitaten, Redline-Diff, Programm-Treue pro Fraktion, Versionshistorie, namentlichem Abstimmungsverhalten (wenn vorhanden)
- Bookmark-Liste (server-seitig pro User), Kommentare, Voting, Share-Buttons (Threads/X/Mastodon mit LLM-Texten), Re-Analyze
- Auswertungen mit BL×Partei-Matrix, Themen×Fraktion-Heatmap, Cluster-Bubble-Chart
- Tag-Cloud, Cluster-Liste, Landtag-Live-Suche, Methodik, Quellen
- Admin-Panel Freischaltungen / Queue / Abos / Wahlprogramme
- Dark-Mode, Phosphor-Icons, Avenir/Nunito-Sans, Keyboard-Shortcuts (j/k/Enter/Esc/?/⏎)
Backend
- FastAPI + Jinja2 + Vanilla JS (kein Build-Tool)
- SQLite mit aiosqlite (Source of Truth)
- Qwen-Plus (DashScope) für die LLM-Bewertung — austauschbar via
LlmBewerter-Port (ADR 0008) - Embeddings v4 für die Zitat-Verifikation (ADR 0006)
- Keycloak SSO mit Direct-Access-Grant (Login-Modal in der App, kein Redirect)
- Background-Queue mit 3 parallelen Workern + Graceful Shutdown
- Daily-Digest-Mail für Abonnent:innen
- Monitoring-Scan aller Adapter mit Kosten-Schätzung — Beobachtung ohne Auto-Fetch
- OG-Cards (Open-Graph-Bilder pro Antrag, Playwright-gerendert)
- WeasyPrint für PDF-Reports
Tests
- 574 Tests, 13 skipped — Unit + Integration + Property + Bug-Regression + DDD
- Live-Adapter-Tests gegen alle 17 Quellen (
pytest -m integration) - Citation-Substring-Verification gegen Original-PDFs
- E2E-Browser-Tests via Playwright (
pytest -m e2e)
Architektur
Detailliert in docs/:
docs/adr/— Architecture Decision Records (8 ADRs)docs/analysen/ddd-bewertung.md— DDD-Analyse + Migrations-Roadmapdocs/reference/zugriffsrechte.md— 63 Routes × User-Status-Matrixdocs/reference/api.md— API-Reference
DDD-Lightweight-Migration ist Tag 1-4 abgeschlossen (Ports, Adapter, Repositories, Domain-Verhalten — siehe ADR 0008). Callsite-Migration in main.py ist Folge-PR.
Schnellstart
Voraussetzungen
- Docker + Docker Compose
- Python 3.12 (für lokale Tests)
- DashScope API-Key (Qwen)
- Keycloak (optional, für Login)
Installation
git clone https://repo.toppyr.de/tobias/gwoe-antragspruefer
cd gwoe-antragspruefer/webapp
cp .env.example .env # API-Keys eintragen
docker compose up -d --build
App auf http://localhost:8000.
Tests
python3 -m pytest tests/ -q # Unit-Suite (574 Tests, < 2 s)
python3 -m pytest tests/ -m integration # Live-Adapter-Tests (langsam)
./scripts/smoke-test.sh # Gesamt-Funktionsprüfung gegen Live
Deploy (Server)
./scripts/deploy.sh # mit Uptime-Kuma-Wartungsmodus
./scripts/run-digest.sh # Daily-Mail-Digest (Cron 07:00)
./scripts/run-monitoring-scan.sh # Monitoring-Scan (manuell oder Cron)
Lizenz
Zwei getrennte Lizenzen:
- Quellcode — MIT
- Bewertungs-Daten und -Berichte (Assessments, Matrix-Zuordnungen, Verbesserungsvorschläge, Themen-Tags etc.) — CC BY 4.0
Wahlprogramme und Antrags-PDFs der Parlamente unterliegen der jeweiligen Urheber-Lizenz der Quelle und werden hier nur zur Verifikation referenziert.
Mitwirken
Issues unter https://repo.toppyr.de/tobias/gwoe-antragspruefer. Pull Requests willkommen — beachte ADR 0004 (Deployment-Workflow) und die Test-Konventionen in pytest.ini.
Statistiken (Stand Release 1.0)
- 16 BL + Bundestag aktiv
- 85 Wahlprogramme indexiert (Embeddings v4)
- 71 produktive Bewertungen in der Live-DB
- 28 977 abgeordnetenwatch-Votes (BUND)
- 11 789 LOC Python in
app/