A newer version of the Streamlit SDK is available: 1.59.2
title: German Promise Tracker DIP KB
emoji: 🗳️
colorFrom: blue
colorTo: green
sdk: streamlit
app_file: app.py
pinned: false
license: mit
German Promise Tracker — Bundestag DIP Knowledge Base
This Hugging Face Space builds a project knowledge base from the German Bundestag DIP API and displays it in a Streamlit dashboard.
The dashboard is designed for a political promise tracker, but it deliberately separates two layers:
- DIP evidence layer: records fetched from the official Bundestag DIP API.
- Reviewed promise layer: human-reviewed promise rows that can link to DIP evidence.
It does not automatically label a promise as completed, broken, or in progress. DIP records are evidence; promise status requires review.
Deployment on Hugging Face Spaces
- Create a new Hugging Face Space.
- Choose Streamlit.
- Upload all files from this folder.
- Add a Space secret called
DIP_API_KEY. - Restart the Space and open the Build / Refresh DIP KB tab.
Local run
pip install -r requirements.txt
export DIP_API_KEY="your-dip-api-key"
streamlit run app.py
Build the knowledge base from the command line
export DIP_API_KEY="your-dip-api-key"
python scripts/build_dip_knowledge_base.py \
--resources vorgang vorgangsposition drucksache \
--wahlperiode 21 \
--date-start 2025-01-01 \
--max-pages 5
Outputs:
data/dip_knowledge_base.csv— normalized dashboard table.data/dip_raw_documents.jsonl— raw API JSON for auditability.data/dip_fetch_metadata.json— fetch parameters and counts.
API resources supported
The direct REST client supports all documented DIP resource types used by the API:
vorgangvorgangspositiondrucksachedrucksache-textplenarprotokollplenarprotokoll-textaktivitaetperson
Optional BundestagsAPy wrapper
The project includes scripts/fetch_with_bundestagsapy_example.py to show how to use the BundestagsAPy wrapper. The production dashboard uses direct REST calls for explicit cursor pagination and schema normalization.
pip install -r requirements-optional.txt
python scripts/fetch_with_bundestagsapy_example.py
Knowledge-base schema
data/dip_knowledge_base.csv uses one row per DIP API record. Important columns include:
resource_typedip_idtitleabstractdateupdatedelection_perioddocument_typedocument_numberprocedure_typeprocedure_positionconsultation_statusinitiativesubject_areadescriptorspdf_urlapi_urlrelated_*_idstext_excerptretrieved_at
Status rule
The app shows consultation_status from the DIP API when available. It does not infer political promise fulfilment. Use manual_promise_tracker_template.csv for reviewed status labels.