GWÖ-Antragsprüfer: Automatische Gemeinwohl-Bilanzierung von Parlamentsanträgen nach der GWÖ-Matrix 2.0
Adds a new ParLDokAdapter for ParlDok 8.x parliament documentation
systems by J3S GmbH. MV becomes the fourth supported state alongside
NRW, LSA and BE.
Notable details:
- ParlDok 8.x is a single-page app whose backend is a JSON API rooted
at {base}/parldok/Fulltext/{Search,Resultpage}. The legacy ParLDok
5.x HTML POST form (parldok/formalkriterien) used by dokukratie's
mv.yml has been deprecated by the LandtagMV upgrade to 8.3.5 and
is no longer reachable via the old form fields — hence a new
adapter rather than reusing the dokukratie scraper.
- Two-stage pagination: Fulltext/Search returns the first 100 hits
+ a queryid; further pages come from Fulltext/Resultpage with
{queryid, limit:{Start,Length}}. The Search endpoint silently
ignores any non-zero Start, so single-stage offset pagination is
not an option.
- Server-side filter via facet_lp (type=10) on the configured WP;
type=Antrag is filtered client-side because the facet_type value
IDs are instance-specific and would require an extra
Fulltext/Filter discovery call. ParlDok also returns the same
Drucksache multiple times when it appears in several
Vorgänge/Beratungen, so search() dedupes by lp/number.
- Wahlprogramme zur LTW 26.09.2021 are not yet indexed (follow-up
in #4) — analyses run with the federal Grundsatzprogramm fallback,
same as Berlin until #10 lands.
Drive-by cleanup of PortalaAdapter print() statements: switched to
the module-level logger so adapter parser bugs no longer disappear
into stdout.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| app | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .tarignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
GWÖ-Antragsprüfer
Automatische Gemeinwohl-Bilanzierung von Parlamentsanträgen nach der GWÖ-Matrix 2.0 für Gemeinden
🎯 Was ist das?
Der GWÖ-Antragsprüfer analysiert Anträge aus Landesparlamenten (aktuell NRW) 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 Felder der GWÖ-Matrix werden adressiert?
- Programmtreue: Passt der Antrag zu Wahl- und Parteiprogrammen?
- Verbesserungsvorschläge: Konkrete Textänderungen mit GWÖ-Begründung
✨ Features
- 🔍 Landtag-Suche: Direkte Anbindung an OPAL (NRW Parlamentsdokumentation)
- 📊 GWÖ-Matrix-Visualisierung: 5×5-Tabelle mit Bewertungssymbolen
- 🏷️ Tag-Wolke: Filter nach Themen mit Multi-Select
- 🎯 Partei-Filter: Durchschnittswerte pro Fraktion
- 📄 PDF-Export: Professionelle Berichte im GWÖ-Design
- 🔒 Security: CSP, CORS, Rate Limiting
🚀 Schnellstart
Voraussetzungen
- Python 3.12+
- Docker & Docker Compose
- DashScope API-Key (Qwen LLM)
Installation
# Repository klonen
git clone https://github.com/tobiasroedel/gwoe-antragspruefer.git
cd gwoe-antragspruefer
# Environment-Variablen
cp .env.example .env
# DASHSCOPE_API_KEY eintragen
# Mit Docker starten
docker compose up -d
# Oder lokal entwickeln
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload
Die App läuft auf http://localhost:8000
📁 Projektstruktur
webapp/
├── app/
│ ├── main.py # FastAPI-Endpoints
│ ├── analyzer.py # LLM-Analyse-Logik
│ ├── database.py # SQLite-Persistenz
│ ├── models.py # Pydantic-Modelle
│ ├── parlamente.py # Landtag-Adapter (OPAL)
│ ├── report.py # PDF-Generierung
│ ├── config.py # Settings
│ ├── kontext/ # GWÖ-Matrix, Wahlprogramme
│ ├── templates/ # Jinja2-HTML
│ └── static/ # CSS, JS, Assets
├── data/ # SQLite-DBs (Volume)
├── reports/ # Generierte PDFs (Volume)
├── docker-compose.yml
├── Dockerfile
└── requirements.txt
🔧 Konfiguration
Environment-Variablen
| Variable | Beschreibung | Default |
|---|---|---|
DASHSCOPE_API_KEY |
Alibaba DashScope API-Key | (required) |
LLM_MODEL_DEFAULT |
Standard-Modell | qwen-plus-latest |
LLM_MODEL_PREMIUM |
Premium-Modell | qwen-max |
Unterstützte Bundesländer
| Code | Name | Status |
|---|---|---|
| NRW | Nordrhein-Westfalen | ✅ Aktiv |
| BY | Bayern | 🔜 Geplant |
| BW | Baden-Württemberg | 🔜 Geplant |
📊 API-Endpoints
| Methode | Pfad | Beschreibung |
|---|---|---|
| GET | / |
Web-UI |
| GET | /api/assessments |
Alle Bewertungen |
| GET | /api/assessment?drucksache=18/12345 |
Einzelne Bewertung |
| POST | /api/analyze-drucksache |
Neue Analyse starten |
| GET | /api/search?q=Klima |
Interne Suche |
| GET | /api/search-landtag?q=Klima |
Landtag-Suche |
| GET | /api/assessment/pdf?drucksache=18/12345 |
PDF-Download |
🧠 GWÖ-Prompt (v5)
Der Analyse-Prompt basiert auf:
- GWÖ-Matrix 2.0 für Gemeinden (Arbeitsbuch)
- ECOnGOOD Corporate Design Manual 2024
- Wahlprogramme der NRW-Landtagsparteien 2022
Ausgabe-Format:
- GWÖ-Score mit Matrix-Feldern und Symbolen (++/+/○/−/−−)
- Wahlprogramm- und Parteiprogrammtreue
- Verbesserungsvorschläge im Redline-Format (Original → Vorschlag → Begründung)
- Themen-Tags für Kategorisierung
🛠️ Entwicklung
# Tests ausführen
pytest
# Linting
ruff check app/
# Type-Checking
mypy app/
📝 Lizenz
MIT License - siehe LICENSE
🙏 Credits
- Gemeinwohl-Ökonomie - Matrix und Arbeitsbücher
- Alibaba DashScope - Qwen LLM API
- Landtag NRW - OPAL-Dokumentation
Entwickelt von Tobias Rödel · tobiasroedel.de