Python application which calls the OpenWeatherMap API to get a 5-day weather forecast, partitioned into 3-hour blocks.
- City Name
- or Zip Code
- City name
- Country code
- Datetime (YYYY-MM-DD HH:MM UTC)
- Weather condition
- Temperature (°C and °F)
- Humidity
-
Get an API key
Sign up and get an API KEY: https://openweathermap.org/api -
Set up environment
Copy the example file and edit your API key:cp .env.example .env
Then open .env and replace with your key:
OPENWEATHER_API_KEY=your-api-key-here
-
Run the app
Using uv:uv run --env-file .env main.py
-
Read the API docs
5-day forecast: https://openweathermap.org/forecast5