How devgamers/changement-climatique-bretagne works
This is a Flask API serving cached French departmental weather observations. At startup it fetches and prepares two datasets for four departments, then stores department-level and annual aggregates in Redis. Request handlers serve cached data or calculate date-based monthly, yearly, and cross-dataset averages. The README is empty and app.py excerpts omit portions of the implementation, so the graph includes only evidenced routes and data flows.
Main entry points: app.py Preload and routes · functions.py Dataset assembly · utils.py CSV and preprocessing · run.py App startup
Components 13
API and loading
- App startup
run.py - Preload and routes
app.py - Gaz endpoint
app.py - Monthly endpoint
app.py - Yearly endpoint
app.py - Annual endpoint
app.py - Average endpoint
app.py
Data preparation
- Dataset assembly
functions.py - Cached CSV loading
functions.py - CSV and preprocessing
utils.py
Cache
- Redis cache
Other components
- API client
- Weather datasets
Connections 21
- API client → Gaz endpoint: requests
- API client → Monthly endpoint: requests
- API client → Yearly endpoint: requests
- API client → Annual endpoint: requests
- API client → Average endpoint: requests
- App startup → Preload and routes: creates app
- Preload and routes → Dataset assembly: loads datasets
- Dataset assembly → Cached CSV loading: loads periods
- Cached CSV loading → CSV and preprocessing: calls
- CSV and preprocessing → Weather datasets: reads CSV
- Preload and routes → Redis cache: writes preload
- Gaz endpoint → Redis cache: reads cache
- Monthly endpoint → Redis cache: reads and writes
- Yearly endpoint → Redis cache: reads and writes
- Annual endpoint → Redis cache: reads cache
- Average endpoint → Redis cache: reads datasets
- Gaz endpoint → API client: returns response
- Monthly endpoint → API client: returns response
- Yearly endpoint → API client: returns response
- Annual endpoint → API client: returns response
- Average endpoint → API client: returns response