A modern desktop Weather Application built with Python, PyQt6, and the OpenWeatherMap API. This application provides real-time weather information for any city with a clean glassmorphism-inspired user interface.
Enter a city name, click Get Weather, and instantly view the current weather conditions along with a weather icon.
- 🌍 Search weather by city name
- 🌡 Displays current temperature in Celsius
- ☁ Shows current weather description
- 😊 Displays weather emoji based on conditions
- 🎨 Modern glassmorphism user interface
- ⚡ Fast API response using OpenWeatherMap
- 🔐 API key stored securely using a
.envfile
- Python 3.x
- PyQt6
- Requests
- Python-dotenv
- OpenWeatherMap API
Weather-App/
│── weather.py
│── .env
│── requirements.txt
│── README.md
git clone https://github.com/your-username/weather-app.git
cd weather-appWindows
python -m venv venv
venv\Scripts\activatemacOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtOr install manually:
pip install PyQt6 requests python-dotenvCreate a .env file in the project root.
API_KEY=YOUR_OPENWEATHERMAP_API_KEYGet your free API key from:
https://openweathermap.org/api
python weather.py-
Enter the name of a city.
-
Click Get Weather.
-
The application sends a request to the OpenWeatherMap API.
-
The API returns the current weather data.
-
The application displays:
- Current temperature
- Weather description
- Matching weather emoji
| Weather Condition | Emoji |
|---|---|
| Clear Sky | ☀️ |
| Few Clouds | ⛅ |
| Cloudy | ☁️ |
| Rain | 🌧️ |
| Snow | ❄️ |
| Unknown | 🌈 |
PyQt6
requests
python-dotenv
- Animated weather backgrounds
- Rain, snow, and cloud animations
- Thunderstorm effects
- Weather forecast for upcoming days
- Humidity display
- Wind speed information
- Feels-like temperature
- Atmospheric pressure
- Sunrise and sunset timings
- Auto-detect current location
- Search history
- Dark and light mode
- Better weather icons
The application handles:
- Invalid city names
- Missing API key
- API request failures
- Network-related errors
Yash Bhat
Built with Python, PyQt6, and the OpenWeatherMap API.
This project is licensed under the MIT License.
Feel free to use, modify, and distribute this project for educational and personal purposes.