You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Sven Geboers a5624f65bc style: humanize reports and translate Streamlit UI to English 5 days ago
.compound-engineering chore: add compound-engineering config example 2 months ago
.github/workflows cleanup: remove Docker, Ansible, and deployment infrastructure 2 months ago
.opencode/skills/score-extremity feat(overton): coherent narrative architecture — Quarto article, Explorer Overton tab, report cleanup 2 weeks ago
.streamlit feat: agent-native refactor, SVD consistency fixes, UX cleanup, mobile support 2 months ago
agent_tools feat: agent-native refactor, SVD consistency fixes, UX cleanup, mobile support 2 months ago
analysis style: humanize reports and translate Streamlit UI to English 5 days ago
ansible added ansible again 2 months ago
data Add debug st.info before st.plotly_chart to diagnose invisible chart 3 months ago
docs feat(overton): coherent narrative architecture — Quarto article, Explorer Overton tab, report cleanup 2 weeks ago
health feat: add pipeline health checks module and CLI runner 2 months ago
migrations feat(similarity): add precomputed similarity cache, fix fusion N+1, add 429 retry 3 months ago
pages feat: agent-native refactor, SVD consistency fixes, UX cleanup, mobile support 2 months ago
pipeline feat: persist and load explained variance for scree plots 2 months ago
reports style: humanize reports and translate Streamlit UI to English 5 days ago
scripts cleanup: archive stale scripts and delete orphaned generate_extra_charts 2 months ago
similarity Refactor tests: replace sys.modules hacks with real DI + in-memory DB 3 months ago
src/validators cleanup: remove stale .mindmodel, old venvs, orphaned code, and transient artifacts 2 months ago
tests refactor: extract shared helpers to common.py, fix bugs, add TDD tests 3 weeks ago
thoughts feat: agent-native refactor, SVD consistency fixes, UX cleanup, mobile support 2 months ago
tools Add debug st.info before st.plotly_chart to diagnose invisible chart 3 months ago
.gitignore chore: remove reports/ from .gitignore, delete stray backfill.py 4 weeks ago
.pre-commit-config.yaml infra: fix CI, config, docker-compose, README, and pre-commit 2 months ago
.python-version feat(pipeline): implement parliamentary embedding pipeline MVP 3 months ago
AGENTS.md docs: add Overton analysis to README and AGENTS conventions 3 weeks ago
ARCHITECTURE.md chore: commit remaining modified files from refactoring 3 months ago
CODE_STYLE.md feat(ansible-example): add @ansible/example package, tests, CI, publish & deploy workflows, docs and changelog 3 months ago
Home.py feat: agent-native refactor, SVD consistency fixes, UX cleanup, mobile support 2 months ago
README.md feat(overton): coherent narrative architecture — Quarto article, Explorer Overton tab, report cleanup 2 weeks ago
STRATEGY.md docs: add STRATEGY.md with product strategy 2 months ago
ai_provider.py feat(overton): coherent narrative architecture — Quarto article, Explorer Overton tab, report cleanup 2 weeks ago
api_client.py refactor: migrate api_client.py prints to structured logging 2 months ago
app.py feat: agent-native refactor, SVD consistency fixes, UX cleanup, mobile support 2 months ago
config.py infra: fix CI, config, docker-compose, README, and pre-commit 2 months ago
database.py refactor: tighten exception handling in database.py and add BLE lint rule 2 months ago
explorer.py feat(overton): coherent narrative architecture — Quarto article, Explorer Overton tab, report cleanup 2 weeks ago
explorer_helpers.py refactor(trajectory): fix code quality issues in centroid diagnostics 3 months ago
logging_config.py feat: add structured logging configuration module 2 months ago
pyproject.toml fix: remove duplicate import and add ruff to dev deps 2 months ago
requirements-dev.txt chore(deps): move pytest to dev-dependencies 3 months ago
scheduler.py fix: remove duplicate import and add ruff to dev deps 2 months ago
streamlit_index.html Add debug st.info before st.plotly_chart to diagnose invisible chart 3 months ago
summarizer.py feat(pipeline): implement parliamentary embedding pipeline MVP 3 months ago
uv.lock fix: remove duplicate import and add ruff to dev deps 2 months ago

README.md

Stemwijzer

A Dutch parliamentary voting compass that lets you vote on real Tweede Kamer motions and see which parties match your positions.

Stemwijzer Explorer

What is Stemwijzer?

Stemwijzer ingests motions and voting records from the Dutch House of Representatives (Tweede Kamer), stores them in DuckDB, generates AI-powered explanations with an LLM, and presents a Streamlit UI where users can vote on real motions and explore party positions through SVD visualizations, trajectory analysis, and embedding-based similarity search.

Features

  • Voting Compass — Vote on real parliamentary motions and see which parties align with your choices
  • Explorer — Interactive SVD visualizations, party trajectories over time, motion browser, and semantic search
  • Analytics — SVD decomposition of voting patterns, UMAP projections, clustering, and drift analysis
  • LLM Enrichment — Automatic generation of layman-friendly motion explanations using QWEN via OpenRouter
  • Overton Window Analysis — Quantitative analysis of whether the Dutch parliamentary center has shifted rightward, using centrist voting support, SVD spatial drift, 2D extremity scoring, and mechanism classification

Prerequisites

  • Python >= 3.13
  • uv for dependency management
  • (Optional) OPENROUTER_API_KEY for LLM enrichment

Quickstart

# Clone and enter the repository
git clone <your-gitea-url>/sgeboers/stemwijzer.git
cd stemwijzer

# Install dependencies
uv sync

# Run the Streamlit app
uv run streamlit run Home.py

# Run the data pipeline (fetch motions, compute embeddings, etc.)
uv run python pipeline/run_pipeline.py

# Run tests
uv run pytest tests/ -q

The app will be available at http://localhost:8501.

Project Structure

├── app.py              # Streamlit UI entrypoint
├── database.py         # DuckDB schema and queries
├── api_client.py       # Tweede Kamer OData API client
├── explorer.py         # Explorer page with SVD visualizations
├── pipeline/           # Data ingestion and analysis pipelines
├── analysis/           # SVD, clustering, trajectory, right-wing motion analysis
├── tests/              # pytest test suite
├── docs/               # Documentation, research, and plans
└── data/motions.db     # DuckDB database (~18 GB)

Documentation

  • ARCHITECTURE.md — Comprehensive architecture overview, tech stack, and contributor guidance
  • CODE_STYLE.md — Coding conventions, naming, typing, and testing standards
  • docs/solutions/ — Documented solutions to past bugs and best practices

Research

  • Overton Window Article — Interactive article: "Has the Dutch Overton window shifted?" with Plotly charts (render with quarto render)
  • Overton Synthesis — Detailed synthesis of all indicators and the "acceptance through moderation" verdict
  • Overton Reports — 13 appendix reports covering breakpoint analysis, SVD drift, 2D extremity, mechanisms, and more (reading guide)
  • Overton Dashboard — Standalone HTML report with gravity-controlled charts and example motions

Tech Stack

  • Language: Python 3.13+
  • Data: DuckDB via ibis-framework
  • UI: Streamlit + Plotly
  • ML/Analysis: scipy, scikit-learn, umap-learn
  • LLM: QWEN via OpenRouter (OpenAI-compatible)
  • Package Manager: uv

License

[Your license here]