Prerequisites
Before you begin, make sure you have the following:- Python 3.x — ClimApp uses f-strings, type hints, and standard library modules that require Python 3.
- An AEMET API key — register for free at opendata.aemet.es. See Configure your AEMET API key for step-by-step instructions.
- git — to clone the repository.
Steps
1
Clone the repository
Clone the ClimApp source code from GitHub and enter the project directory:
2
Install dependencies
Install all required Python packages from This installs the following packages:
requirements.txt:flask— the web framework that powers ClimApp’s routes and templates.python-dotenv— loads environment variables from your.envfile intoos.getenv.requests— used byWeatherAPIServiceto call the AEMET API.pandas— available for data processing and manipulation.pytest— the test runner for the project’s test suite.
3
Configure environment variables
Create a
.env file in the project root with your AEMET API key and a Flask session secret:AEMET_API_KEY is required — the app raises a ValueError at startup if it is missing. SECRET_KEY is optional and defaults to clave_secreta if not set.4
Run the application
Start the Flask development server:The server starts on
host 0.0.0.0, port 5000, with debug mode enabled. You should see output similar to:5
Open in browser and allow location permission
Open http://localhost:5000 in your browser. When the dashboard loads, your browser will prompt you for location permission. Click Allow so ClimApp can read your GPS coordinates and find the nearest AEMET observation station.
ClimApp uses your browser’s Geolocation API to obtain your
latitude and longitude, then passes them as query parameters to the /api/clima endpoint. The server calculates the distance to every active AEMET station and returns weather data from the geographically closest one.