This project is a Weather App CLI that fetches real-time weather data from WeatherAPI.
It demonstrates:
- 🌐 API integration in Python.
- 🔑 Using environment variables (
.env) for security. - 📊 Displaying weather details like temperature, wind, humidity, and conditions.
- 🔍 Search weather by city or location.
- 🌡️ Shows current temperature & feels-like values.
- 🌬️ Displays wind speed and humidity.
- ☁️ Provides weather description (e.g., "Cloudy", "Rainy").
- 🔑 Secure API key management with dotenv.
- Python 3.x
- Requests – For HTTP requests
- python-dotenv – For secure API keys
- WeatherAPI – Data provider
-
Clone the project folder:
git clone https://github.com/your-repo/Project_11_Weather_App.git cd Project_11_Weather_App -
Install dependencies:
pip install requests python-dotenv
-
Get a free API key from WeatherAPI.
-
Create a
.envfile in the project root:API_KEY=your_weatherapi_key_here
Run the app:
python weather_app.pyExample:
Enter Location: Kolkata
Weather of Kolkata, West Bengal
--------------------------------------------
Temp: 30 °C | Feels: 33 °C |
Wind: 12 km/h|
Humidity: 78% | description: Partly cloudy
To quit, enter:
Enter Location: q
Project_11_Weather_App/
│── README.md
│── weather_app.py
│── .env.example
- ✅ Use APIs to get real-world data.
- ✅ Always keep API keys secret with
.env. - ✅ Handle status codes and possible API errors gracefully.