This is a simple yet powerful weather application built in Python. It provides real-time weather information for any location, giving users access to current conditions, forecasts, and more. The app utilizes the OpenWeatherMap API to fetch accurate and up-to-date weather data.
- Displays temperature (in Celsius), feels like temperature, pressure, humidity, sunrise, sunset, cloudiness, and weather description.
- Provides error handling for cases where the entered city name is not found.
tkinter
: Used for creating the graphical user interface.requests
: Used for making HTTP requests to the OpenWeatherMap API.json
: Used for handling JSON responses.datetime
: Used for formatting time information.
Before running the program, make sure you have the following:
- Python installed on your machine.
- An API key from OpenWeatherMap. You can obtain a free API key by signing up on the OpenWeatherMap website.
-
Clone the repository:
git clone https://github.com/ningerson2002/weather-app.git
-
Install required dependencies:
pip install -r requirements.txt
-
Obtain an API key from OpenWeatherMap and replace
YOUR_API_KEY
in the code with your actual API key. -
Run the app:
python weather_app.py
-
Run the app.
-
Enter desired city name in the input field.
-
Click the "Check Weather" button to retrieve and display the current weather information for the specified city.
- Python: The core programming language for the application.
- Requests: Used for making HTTP requests to the OpenWeatherMap API.
- Tkinter: The GUI toolkit for creating the graphical user interface.
This project is licensed under the MIT License - see the LICENSE file for details.
Make sure to handle your OpenWeatherMap API key securely and avoid sharing it publicly.