This project is a GUI-based Weather Application developed using Python and Tkinter. It allows users to search for real-time weather information of any city using the OpenWeatherMap API. The app also stores searched weather data in a CSV file and provides options to view and clear past search history.
-
Graphical User Interface using Tkinter
-
Real-time weather data fetching
-
Displays:
- Weather condition
- Temperature (Β°C)
- Humidity (%)
- Wind speed (m/s)
-
Weather icon display
-
Stores search history in a CSV file
-
View and clear previous weather searches
-
Error handling for invalid city names and empty input
- Python 3
- Tkinter (GUI)
- Requests (API calls)
- Pillow (PIL) (Image handling)
- CSV module (Data storage)
- OpenWeatherMap API
Weather-App/
β
βββ weather.py # Main Python application
βββ weather_history.csv # Stores weather search history
βββ README.md # Project documentation
Ensure you have Python 3 installed. Install the required libraries using:
pip install requests pillow
- Create an account on OpenWeatherMap.
- Generate your API key.
- Replace the API key in the code:
api_key = "YOUR_API_KEY"- Download or clone the project.
- Open a terminal in the project directory.
- Run the Python file:
python weather.py
- Enter a city name and click Get Weather.
- The user enters a city name.
- The app sends a request to the OpenWeatherMap API.
- Weather details and icons are displayed on the GUI.
- The data is saved in
weather_history.csv. - Users can view or clear previous search history.
Weather: Clear sky
Temperature: 30Β°C
Humidity: 55%
Wind Speed: 4.2 m/s
- Add 5-day weather forecast
- Improve UI design
- Add search by GPS location
- Convert into a desktop executable (.exe)
This project is created as a learning and educational purposes.