Skip to main content

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.

ClimApp stores every manual climate entry in a local JSON file and exposes it through a filterable query view at /consulta. You can narrow results by municipality name and date to quickly locate specific observations, making it straightforward to audit past readings or prepare data for the comparison tool.

How to access

Navigate to /consulta using the Histórico link in the navigation bar, or visit the route directly. On a GET request the page loads with all stored records displayed. Apply filters using the form to reduce the result set.

Filtering options

The query form accepts two optional filters. You can use either one alone or combine them.

Municipality

A free-text search against the municipio field. The match is case-insensitive and uses substring matching, so entering mad will match Madrid. Accents and capitalisation are normalised before comparison.

Date

Enter the date in YYYY-MM-DD format using the date picker in the form. The controller converts this to DD/MM/YYYY internally before querying the stored records, which always use the DD/MM/YYYY format.

What the results show

Each matching record is rendered as a row in the results table. The following fields are displayed:
FieldDescription
estacion_idAEMET station identifier associated with the observation
fechaObservation date in DD/MM/YYYY format
temperaturaTemperature in °C
humedadRelative humidity in %
vientoWind speed in km/h
lluviaRainfall in mm
municipioMunicipality name as recorded at submission time
fuenteData origin — "manual" for user entries

How filtering works under the hood

The /consulta route is handled by view_controller.py. On a POST request it reads the form values, converts the date format, and calls filter_records() — a thin wrapper around JSONRepository.filtrar_registros(). The repository applies the three available filters sequentially:
# repositories/json_repository.py — filtrar_registros()

# 1. Municipality filter (case-insensitive substring match)
if municipio:
    datos = [r for r in datos if municipio.lower() in str(r.get('municipio', '')).lower()]

# 2. Date filter (exact string match on DD/MM/YYYY)
if fecha:
    datos = [r for r in datos if str(r.get('fecha')) == str(fecha)]

# 3. Source filter (exact match — 'manual' or 'aemet')
if fuente:
    datos = [r for r in datos if r.get('fuente') == fuente]
The fuente filter is not exposed in the query form but is used internally by the comparison tool to isolate manual records.
Municipality names are stored exactly as they were entered or resolved at submission time (e.g. "Madrid", "Sevilla"). The query uses substring matching, so partial names work — but if you want precise results, enter the municipality name as it appears in estacion_por_municipio.json. You can check that file at static/js/estacion_por_municipio.json in the project source.
If no filters are applied, the page displays every record currently stored in data/registros_climaticos.json. For large datasets, apply at least a municipality or date filter to keep the result set manageable.

Build docs developers (and LLMs) love