An open API service indexing awesome lists of open source software.

https://github.com/ksganni/weather-app-using-python

๐ŸŒฆ๏ธ A simple Python desktop app using tkinter that displays live weather info for any city via the OpenWeatherMap API.
https://github.com/ksganni/weather-app-using-python

openweathermap-api python python-dotenv requests tkinter-gui

Last synced: 15 days ago
JSON representation

๐ŸŒฆ๏ธ A simple Python desktop app using tkinter that displays live weather info for any city via the OpenWeatherMap API.

Awesome Lists containing this project

README

          

# ๐ŸŒฆ๏ธ Weather App in Python (tkinter + OpenWeatherMap API)

A beginner-friendly desktop GUI application built in Python using **tkinter** that shows **live weather information** (temperature, description, and wind speed) based on **city input** using the **OpenWeatherMap API**.

---

## ๐Ÿ“Œ Features

- ๐ŸŒก๏ธ Real-time weather data (temperature, weather description, wind speed)
- ๐Ÿ–ฅ๏ธ tkinter-based GUI
- โš ๏ธ API error handling (invalid city, no input, internet errors)

---

## ๐Ÿ“ท Screenshots

Screenshot 2025-08-01 at 9 05 33 PM
Screenshot 2025-08-01 at 9 05 42 PM
Screenshot 2025-08-01 at 7 12 18 PM

---

## ๐ŸŽฅ Demo Video

https://github.com/user-attachments/assets/0669542f-814f-4560-aa88-b854f5c8239d

---

## ๐Ÿ› ๏ธ Tech Stack

- Python
- tkinter (standard GUI library)
- OpenWeatherMap API
- requests
- python-dotenv

---

## ๐Ÿ“ Project Structure

```
weather_app/
โ”‚
โ”œโ”€โ”€ main.py # Main app code
โ”œโ”€โ”€ .env # Stored API key ( not pushed to Github repo )
โ”œโ”€โ”€ .gitignore # Hides files
โ”œโ”€โ”€ requirements.txt # Project dependencies
โ””โ”€โ”€ README.md # This file
```

---

## โš™๏ธ Setup Instructions

### 1๏ธโƒฃ Clone the Repository

```bash
git clone https://github.com/yourusername/weather_app.git
cd weather_app
```

### 2๏ธโƒฃ Create Virtual Environment

๐Ÿ”น **Windows:**
```bash
python -m venv venv
venv\Scripts\activate
```

๐Ÿ”น **macOS/Linux:**
```bash
python3 -m venv venv
source venv/bin/activate
```

### 3๏ธโƒฃ Install Dependencies

```bash
pip install -r requirements.txt
```

### 4๏ธโƒฃ Get Your API Key

1. Go to [OpenWeatherMap API](https://openweathermap.org/api)
2. Sign up for a free account
3. Copy your API key from the **"API Keys"** section

### 5๏ธโƒฃ Add API Key to `.env` File

Create a `.env` file in the root of your project and add:

```ini
OPENWEATHER_API_KEY=your_api_key_here
```

๐Ÿ” **Never share this file or commit it to GitHub**

### 6๏ธโƒฃ Run the App

```bash
python main.py
```

---

## ๐Ÿงช How to Use

1. Launch the app
2. Enter a **city name** (e.g., `London`)
3. Click the **"Get Weather"** button
4. View the temperature, weather condition, and wind speed

---