A simple weather application that provides current weather information for a given city. It retrieves weather data from the OpenWeatherMap API and displays the temperature, humidity, and weather description.
- Get the current weather information for a city
- Display temperature in Celsius or Fahrenheit
- User-friendly graphical user interface (GUI)
- Python 3.7 or above
- Requests library: Install it using
pip install requests
- Tkinter library (usually included with Python)
-
Clone the repository or download the project files.
-
Obtain an API key from OpenWeatherMap:
- Visit the OpenWeatherMap website: https://openweathermap.org/
- Sign up for a free account or log in if you already have one.
- Navigate to your account dashboard and find your API key.
-
Open the
app.py
file in a text editor. -
Replace
"YOUR_API_KEY"
in thefetch_weather_data
function with your actual OpenWeatherMap API key. -
Save the file.
-
Open a terminal or command prompt and navigate to the project directory.
-
Run the following command to start the application: python app.py
-
The Weather App window will open.
-
Enter the name of a city in the text field.
-
Choose the desired temperature units (Celsius or Fahrenheit) using the radio buttons.
-
Click the "Get Weather" button.
-
The current weather information for the specified city will be displayed below.
-
To check the weather for another city, repeat steps 4-7.
This project is licensed under the MIT License. See the LICENSE file for details.
- OpenWeatherMap for providing the weather data API.
- Tkinter for the GUI toolkit.
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please open an issue or submit a pull request.