Skip to content

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

🌦️ PyQt5 Weather App

A beautiful and responsive desktop Weather Application built with PyQt5, powered by the OpenWeatherMap API. Enter your city name to instantly get temperature, weather condition, and a corresponding emoji.


πŸš€ Features1

  • Real-time weather info via OpenWeatherMap
  • Temperature in Celsius
  • Weather condition description
  • Dynamic weather emojis (β˜€οΈ 🌦️ ❄️ etc.)
  • Clear UI with Qt layouts and custom CSS styles
  • Full error handling for various HTTP response codes.

πŸ–₯️ Screenshots

(Add a screenshot here once available)
Weather App Screenshot


πŸ› οΈ Requirements

  • Python 3.x
  • PyQt5
  • Internet connection (to fetch API data)
  • OpenWeatherMap API key

πŸ”§ Install Dependencies

pip install pyqt5 requests
πŸ§ͺ How to Run
Clone this repository or download the code.

Replace the default api_key in the script with your own OpenWeatherMap API key.

python
Copy
Edit
api_key = "YOUR_API_KEY_HERE"
Run the app:

bash
Copy
Edit
python weather_app.py
🌍 API Information
This app uses OpenWeatherMap to fetch real-time weather data.

Endpoint used:

bash
Copy
Edit
https://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}

🎨 UI & Layout
Built with QVBoxLayout for vertical stacking

Styled using Qt's setStyleSheet() for CSS-like customization

Dynamic emoji rendering using Unicode based on weather conditions

⚠️ Error Handling
The app gracefully handles:

City not found (404)

No internet connection

API authentication errors (401)

API rate limits and server errors

πŸ’‘ Emojis Mapping
Weather Code Range	Emoji
200–232 (Thunder)	🌦️
300–321 (Drizzle)	🌧️
500–531 (Rain)	☁️
600–622 (Snow)	❄️
701–762 (Mist etc.)	β˜€οΈ
800–804 (Clear/Clouds)	β˜€οΈ
Others	😐

πŸ“ Project Structure
bash
Copy
Edit
weather-app/
β”œβ”€β”€ weather_app.py       # Main application code
β”œβ”€β”€ README.md            # You're reading this!

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages