A simple Python desktop application to get current and historical weather data for any location using:
- OpenWeatherMap API (for current weather)
- Open-Meteo API (for historical data trends)
- Built with Tkinter and Matplotlib for GUI and visualization
- Supports JSON export and graphical display of past temperature and rainfall
- Search weather by place name
- Displays:
- Cloud cover
- Humidity
- Max, Min, and Feels-like temperature
- Rain (mm/hr)
- Plots 15-day historical temperature and rainfall
- Export JSON weather data
- Built with Python, no heavy external dependencies
Python 3.8+ Required.
Install required packages:
pip install -r requirements.txt-
Sign up and get a free API key from OpenWeatherMap.
-
Create a
.envfile in the root of your project:API_KEY=your_api_key_here
-
The app will read this key using
python-dotenv.
-
Clone this repo:
git clone https://github.com/LN-simhan/weather-app.git cd weather-app -
(Optional) Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Run the app:
python app.py
weather-app/
│
├── app.py # Main application code
├── requirements.txt # Required dependencies
├── .env # API key (To be created)
├── README.md # This file
└── output/
│
├── data.json # Current weather data retrieved from API
└── weather_data.json # (Will be generated if downloaded) Sample Output file
- Python 3.x
- Tkinter (GUI)
- Matplotlib (plots)
- OpenWeatherMap API
- Open-Meteo API
- pandas, requests, dotenv
- Place lookup is done using Photon (Komoot)
- Open-Meteo provides free historical weather without API keys. (Free for non-commercial use with rate limiting)
- Rainfall and temperature data is approximate for the given coordinates
This project is open-source and free to use under the MIT License.


