How tibotsr/calendrier-france-ics works
Purpose and entry points
Calendrier Complet France generates and publishes French calendar data as ICS, JSON, CSV, XML, and profile/education-zone feeds, with a static browser UI and Vercel serverless APIs. Main generation entry point: calendrier.py; generation orchestration: calendar_core/generator.py. Public UI starts at index.html; dynamic ICS begins at api/calendrier.ics.js.
Calendar domain model and configuration
calendar_core/models.py defines the event representation shared through collection, filtering, and export. calendar_core/config.py centralizes calendar constants and profile definitions. Date manipulation and shared domain calculations reside in calendar_core/utils.py.
Event acquisition and composition
calendar_core/providers.py is the primary aggregation boundary for event sources. It composes internal specialist domains: holidays and celebrations (calendar_core/society/holidays.py, calendar_core/society/celebrations.py), school/exam schedules (calendar_core/education/vacations.py, calendar_core/education/exams.py), sports (calendar_core/sports/football.py), astronomy (calendar_core/astronomy/moon.py, calendar_core/astronomy/seasons.py), elections, and wiki-backed content (calendar_core/elections.py, calendar_core/wiki/api.py).
Generation and export pipeline
calendrier.py invokes the core pipeline, which gathers normalized events, applies zone/profile/category decisions, and writes repository-root artifacts. calendar_core/generator.py controls output production; calendar_core/exporters.py serializes ICS and related output forms; calendar_core/parsers.py supports input parsing. Principal generated/public artifacts include calendrier.ics, calendrier.json, events-meta.json, and zone feeds such as zone-a.ics.
Data and mutable content boundary
Curated and operational source data is versioned under calendar_core/data/, including calendar_core/data/exams.json, calendar_core/data/sports.json, and calendar_core/data/pending_events.json. Wiki retrieval has an explicit cache layer in calendar_core/wiki/cache.py, separating external content access from generation. Repository-root zone-departments.json supports geographic school-zone mapping.
Static client application
The client is a vanilla static application rooted at index.html, styled through assets/css/styles.css, and coordinated by assets/js/app.js. UI state and synchronization are separated into assets/js/state.js and assets/js/sync.js; calendar visualization and exploration are handled by assets/js/calendar-grid.js and assets/js/explorer.js. It consumes generated calendar artifacts and API responses rather than owning calendar generation logic.
Serverless API and administration
Vercel functions in api/ expose calendar data and interactive features. Dynamic feed generation is implemented by api/calendrier.ics.js; pending/community event flows use api/pending-events.js and api/suggestions.js; rendered event pages use api/event-page.js. Administrative browser surfaces are under admin/, with auth and calendar/data management endpoints in api/admin-auth.js, api/admin-calendar.js, and api/admin-data.js.
Delivery and runtime infrastructure
Python is the generation runtime; browser JavaScript serves the static UI; Node/Vercel functions serve dynamic APIs. vercel.json configures Vercel deployment behavior. .github/workflows/update_ics.yml automates regeneration/publication on schedule, pushes, and manual dispatch. The site also includes PWA deployment assets (manifest.json, sw.js) and static hosting markers (CNAME).
Components 19
Python generation
- Calendar generator CLI
calendrier.py - Generation pipeline · Collects, filters, and produces calendar outputs.
calendar_core/generator.py - Calendar domain
calendar_core/models.py - Profiles and constants
calendar_core/config.py - Export serializers
calendar_core/exporters.py - Published calendar artifacts · ICS, JSON, metadata, and school-zone feeds.
calendrier.ics
Event sources
- Event provider aggregation
calendar_core/providers.py - Specialist event domains · Includes holidays, celebrations, vacations, exams, football, moon, and seasons.
calendar_core/society/holidays.py - Elections and wiki content
calendar_core/elections.py - Wiki cache
calendar_core/wiki/cache.py - Curated source data · Exam, sports, and pending-event data.
Static client
- Browser application
index.html - UI state and sync
assets/js/app.js - Calendar explorer
assets/js/calendar-grid.js
Vercel APIs
- Dynamic ICS feed
api/calendrier.ics.js - Community event APIs · Accepts pending events and suggestions.
api/pending-events.js - Administration · Authentication plus calendar and data management.
Delivery
- Vercel deployment
vercel.json - Scheduled publication · Regenerates and publishes feeds on schedule, push, or dispatch.
.github/workflows/update_ics.yml
Connections 22
- Calendar generator CLI → Generation pipeline: invokes
- Generation pipeline → Calendar domain: uses events
- Generation pipeline → Profiles and constants: applies profiles
- Generation pipeline → Event provider aggregation: collects
- Event provider aggregation → Specialist event domains: composes
- Event provider aggregation → Elections and wiki content: collects
- Elections and wiki content → Wiki cache: caches retrieval
- Event provider aggregation → Curated source data: reads
- Generation pipeline → Export serializers: serializes through
- Export serializers → Published calendar artifacts: writes
- Scheduled publication → Calendar generator CLI: runs generation
- Browser application → UI state and sync: boots
- UI state and sync → Calendar explorer: coordinates
- Calendar explorer → Published calendar artifacts: loads feeds
- Browser application → Dynamic ICS feed: requests dynamic ICS
- Browser application → Community event APIs: submits events
- Community event APIs → Curated source data: manages pending data
- Administration → Community event APIs: reviews content
- Vercel deployment → Browser application: hosts
- Vercel deployment → Dynamic ICS feed: runs
- Vercel deployment → Community event APIs: runs
- Vercel deployment → Administration: serves