Skip to content

EFK-CDF-SFAO/Parlement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

789 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ SFAO Parliament Monitor

Parliamentary monitoring tool for the Swiss Federal Audit Office

Website Objects Debates Languages


CDF_Parlement


✨ Features

πŸ“Š Parliamentary Objects 🎀 Debates πŸ“ˆ Statistics
Motions, postulates, interpellations, questions Plenary session transcripts Analysis by year, party, council
Full-text search Speaker and party filters Interactive charts
Advanced filters (themes, department, session) Full intervention text Export options

🏷️ Thematic Labels

  • TPF (Transparency of Political Financing): automatic detection of items related to campaign financing, party funding, and political transparency
  • Keyword-based regex matching on titles and texts (FR/DE/IT)
  • Displayed as badges on object and debate cards (homepage, objects, debates)
  • Available as a filter in the tags dropdown
  • Only applies to items from 2020 onwards

πŸ” Advanced Search

  • Full-text search in titles and submitted texts
  • Multiple filters: type, council, year, party, department, themes, legislature, session
  • Highlighting of search terms
  • Responsive interface (desktop + mobile)

πŸ€– AI Summary (Debates)

Generate AI-powered summaries of parliamentary debates with one click:

  • Model: Anthropic Claude (via Cloudflare Worker proxy)
  • Languages: FR, DE, IT
  • Content: Context, speaker positions, consensus points, divergences

πŸ›οΈ Live Session Animation

During parliamentary sessions, the homepage displays an animated pixel art Federal Palace:

  • Dynamic sky: changes based on time of day (morning 7:45-8:00, day 8:00-19:00, evening 19:00-21:00, night 21:00-7:45)
  • Auto-activation: starts at 12:00 on the first day of session, ends at 12:00 on the last day
  • New objects display: shows newly submitted parliamentary objects during the session

Animation schedule by day:

Day Characters Debate bubbles
Monday 14:30-15:00 15:00-19:00
Tuesday-Thursday 7:45-8:00 + 14:30-15:00 8:00-13:00 + 15:00-19:00
Friday (1st & 2nd) β€” β€”
Friday (last) 7:45-8:00 8:00-12:00
Saturday-Sunday β€” β€”

The sky background always changes according to the time, even on days without animations.


πŸ“± Progressive Web App (PWA)

The site can be installed as a standalone app on any device β€” no app store required.

How to install

Platform Steps
Chrome / Edge (desktop) Click the install icon (βŠ•) in the address bar β†’ Install
Android (Chrome) Tap the browser menu β†’ Add to Home screen
iPhone / iPad (Safari) Tap the Share icon β†’ Add to Home Screen

Once installed, the app:

  • Opens in standalone mode (no browser UI)
  • Is accessible via home screen / dock shortcuts
  • Includes quick shortcuts to Objects, Debates and Statistics
  • Uses a network-first service worker β€” always loads fresh data when online, falls back to cache when offline

Technical details

  • manifest.json β€” app metadata, theme color, icons
  • sw.js β€” service worker (network-first strategy, no pre-caching)
  • Icons available in SVG (192Γ—192 and 512Γ—512, maskable)

️ Coverage

Legislature Period Sessions
50th Dec. 2015 – Sept. 2019 5001-5019
51st Dec. 2019 – Sept. 2023 5101-5122
52nd Dec. 2023 – ongoing 5201+

βš™οΈ Technical Architecture

πŸ“ Parlement/
β”œβ”€β”€ 🌐 Website (GitHub Pages)
β”‚   β”œβ”€β”€ index.html / index_de.html / index_it.html
β”‚   β”œβ”€β”€ objects.html / debates.html / stats.html
β”‚   β”œβ”€β”€ app.js / stats.js
β”‚   └── llm_summary.js         β†’ AI summary module
β”œβ”€β”€ πŸ“Š R Scripts
β”‚   β”œβ”€β”€ Recherche_CDF_EFK.R    β†’ Parliamentary objects
β”‚   └── Recherche_Debats.R     β†’ Debates
└── πŸ“„ Data
    β”œβ”€β”€ cdf_efk_data.json      β†’ Objects
    └── debates_data.json      β†’ Debates

πŸ”§ Developer Setup

Requirements

  • R 4.0+ with packages: swissparl, dplyr, stringr, tidyr, jsonlite, openxlsx
  • Git for version control

R Package Installation

install.packages(c("dplyr", "stringr", "tidyr", "xfun", "openxlsx", "jsonlite", "httr", "lubridate"))
remotes::install_github("zumbov2/swissparl")

Running the Scripts

# Parliamentary objects (incremental mode: last 6 months)
Rscript Recherche_CDF_EFK.R

# Debates (scan only recent sessions)
Rscript Recherche_Debats.R

πŸ€– Automation

Data is automatically updated via GitHub Actions:

Frequency Action
Twice daily at 13:00 and 22:00 (Swiss time) Update parliamentary objects
Twice daily at 13:00 and 22:00 (Swiss time) Update debates (during sessions only)

Manual trigger: Actions tab β†’ Select workflow β†’ Run workflow


πŸ“š APIs Used


πŸ“„ License

MIT License