ClimApp is a Flask web application that connects to AEMET (Agencia Estatal de Meteorología), Spain’s official meteorological agency, to deliver live weather observations directly in your browser. Using your device’s GPS coordinates, ClimApp identifies the nearest AEMET station and returns current conditions — temperature, humidity, wind speed, pressure, and rainfall — normalized and ready for display. Beyond live data, ClimApp lets you log manual climate readings, query historical records, and compare your entries against official AEMET values.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/adrianaarang/climapp/llms.txt
Use this file to discover all available pages before exploring further.
What ClimApp does
Dashboard
View real-time temperature, humidity, wind speed, pressure, and rainfall from the nearest AEMET observation station.
Manual entry
Log your own climate readings for any municipality with validation and persistent JSON storage.
Historical records
Filter and browse stored records by municipality and date using the
/consulta route.Data comparison
Compare your manual entries against official AEMET readings via the
/comparar route to flag discrepancies.Key capabilities
- GPS-based station lookup — the
/api/climaendpoint acceptslatandlonquery parameters, then finds the geographically closest AEMET observation station using a Haversine distance calculation. - Automatic data normalization — raw AEMET fields (
ta,hr,vv,pres,prec,ubi,fint) are mapped to readable keys (temperatura,humedad,viento,presion,lluvia,estacion,fecha) before being returned to the client. - Alert evaluation — after normalization,
AlertServiceevaluates the weather values and attaches alert labels to the response under analertaskey. - Manual data entry — a dedicated form-backed blueprint (
manual_bp) allows logging climate readings that are persisted locally in JSON format. - Historical queries — the
/consultaroute filters stored records by municipality name and date, with automatic date format conversion between HTMLYYYY-MM-DDand the storedDD/MM/YYYYformat. - Side-by-side comparison — the
/compararroute retrieves both a manual record and a live AEMET reading for the same municipality and date, then presents them together. - Breadcrumb navigation — a context processor automatically generates breadcrumb data for every page based on the current URL path.
How ClimApp connects to AEMET
ClimApp uses a deliberate two-step fetch pattern when calling the AEMET API. TheWeatherAPIService class sends an initial GET request to the conventional observation endpoint:
datos field — a second, temporary URL that holds the actual observation records. ClimApp immediately follows up with a second GET request to that datos URL to retrieve the full list of station readings. This two-step indirection is part of AEMET’s API design. Both requests use a retry-enabled session (get_retry_session) and a 20-second timeout to handle transient network errors gracefully.
Once the full observation list is returned, ClimApp iterates over every station, calculates the distance to the user’s coordinates, and returns the single closest match.
You need a free AEMET API key to run ClimApp. Register at opendata.aemet.es to request one. Without this key, the application will raise a
ValueError on startup and refuse to serve weather data.