A simple Python application that fetches current weather data for a given city using the OpenWeatherMap API. The app provides real-time weather information, including temperature, weather conditions, humidity, and wind speed.
- Retrieve current weather data for any city.
- Displays temperature in Celsius.
- User-friendly interface to input city names.
These instructions will help you set up the project on your local machine.
- Python 3.x installed on your machine.
- An OpenWeatherMap API key (sign up for free here).
-
Clone the repository:
git clone https://github.com/jithinjithu10/weather_app.git cd weather_app
-
Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate # For Windows
-
Install the required packages:
pip install -r requirements.txt
-
Open the
weather_app.py
file:- Open
weather_app.py
in your preferred code editor. - Replace the placeholder
your_openweather_api_key
with your actual API key.
- Open
-
Run the application:
python weather_app.py
-
Enter the city name when prompted.
Example input:
Enter the city name: New York
-
View the weather data displayed on the console.
When you run the app and input a city name, the output will look like this:
City: New York
Temperature: 25°C
Weather: clear sky
Humidity: 60%
Wind Speed: 5 m/s
- Error: Could not retrieve weather data. Please check the city name.
- Ensure the city name is correct.
- Verify that your API key is valid.
- Check your internet connection.
This project is licensed under the MIT License.
- OpenWeatherMap for providing the weather data API.