● Case study
ReadMyWeather
A REST API that turns live MeteoSwiss data into answers, with a Streamlit dashboard on top.
The idea
MeteoSwiss publishes the latest readings of its automatic weather stations as one raw CSV file. Useful, but not something a normal person can read. ReadMyWeather is a web service built on top of it: it does not just relay the data, it turns it into averages, comfort labels, filters and practical advice.
To prove the API works for any client, we built a Streamlit dashboard that uses it the way a third party would: no direct access to the data, only HTTP requests.
Architecture
Three layers, each with one job.
- Data. The official MeteoSwiss CSV is downloaded and cached as JSON, refreshed at most every 10 minutes. Station names and cantons come from an XML file.
- API. A Flask service applies the business logic (filters, averages, transformations) and answers in JSON.
- Client. A Streamlit dashboard that only talks to the API, so the same backend could serve a mobile app or another website unchanged.
GET / # service status and list of endpoints GET /raw # parsed MeteoSwiss readings, one entry per station GET /canton_stats # average temperature per canton GET /comfort # "feels like" label for each station POST /search # {"min_temp": -10, "max_temp": 40, "canton": "GE"}
The endpoints exposed by ReadMyWeather_API.py.
What it does
- Comfort index. Temperature and humidity become a label anyone understands: cold, pleasant, heavy or scorching.
- Canton averages. Stations are grouped by canton through the XML metadata and averaged into one temperature.
- Advanced search. A POST request with a temperature range and an optional canton returns only the matching stations.
- Local weather. Pick a canton and get its readings, clothing advice and rain or wind warnings, over a photo of its main city.
- Wind alerts. Stations above an adjustable km/h threshold, with the reading translated to the Beaufort scale.
- Raw data. Every parsed MeteoSwiss reading in one table, with a refresh button.
A look at the dashboard
Results
A working mashup: live public data in, a JSON API out, and a dashboard that proves it from the outside. Filtering, transformation and group aggregation turn raw measurements into information a normal user can read at a glance.
Honest limits: the comfort labels follow simple temperature and humidity rules rather than a meteorological model, and the API and the dashboard run as two local processes.