Welcome to the Weather App! This Python application allows users to get current weather information for any city around the world. It utilizes the OpenWeatherMap API to fetch real-time weather data and provides a simple command-line interface for interaction.
- Current Weather: Fetches and displays the current weather conditions for a specified city.
- Temperature Information: Provides temperature in Celsius (or Fahrenheit if you prefer).
- Weather Description: Displays a brief description of the weather conditions (e.g., clear sky, light rain).
- Python 3.x installed on your system.
- An API key from OpenWeatherMap.
-
Clone the Repository:
git clone https://github.com/yourusername/weather-app.git
-
Navigate to the Project Directory:
cd weather-app
-
Install Dependencies:
The application requires the
requests
library. You can install it using pip:pip install requests
-
Obtain Your API Key:
- Sign up at OpenWeatherMap.
- Navigate to your API keys section and generate a new API key.
-
Update the API Key:
Open the
weather_app.py
file and replace'YOUR_API_KEY'
with your actual OpenWeatherMap API key:api_key = 'YOUR_API_KEY'
-
Run the Script:
Execute the script using Python:
python weather_app.py
-
Input the City Name:
When prompted, enter the name of the city for which you want to retrieve the weather information.
-
View the Results:
The script will display the current temperature and weather description for the specified city.
Enter city name: Delhi
Weather in Delhi:
Temperature: 30°C
Description: Clear sky
- Invalid API Key: Ensure you have correctly replaced
'YOUR_API_KEY'
with a valid key from OpenWeatherMap. - City Not Found: Verify the city name is correct and spelled properly.
We welcome contributions from the community! If you have ideas for new features or improvements, please follow these steps:
-
Fork the Repository: Click the "Fork" button at the top right of this page.
-
Clone Your Fork:
git clone https://github.com/yourusername/weather-app.git
-
Create a New Branch:
git checkout -b feature-branch
-
Make Your Changes: Implement your improvements or new features.
-
Commit Your Changes:
git add . git commit -m "Add new feature"
-
Push to Your Fork:
git push origin feature-branch
-
Create a Pull Request: Go to the original repository and click "New Pull Request" to submit your changes.
This project is licensed under the MIT License - see the LICENSE file for details.