https://github.com/10daviesb/weather-app
A modern Python desktop weather app with live city selection, flag emojis, and a stylish Tkinter GUI. Built with OpenWeatherMap API.
https://github.com/10daviesb/weather-app
api-integration desktop-application gui openweathermap portfolio-project python tkinter weather-app
Last synced: about 1 year ago
JSON representation
A modern Python desktop weather app with live city selection, flag emojis, and a stylish Tkinter GUI. Built with OpenWeatherMap API.
- Host: GitHub
- URL: https://github.com/10daviesb/weather-app
- Owner: 10daviesb
- License: mit
- Created: 2025-04-29T15:58:11.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-30T15:15:24.000Z (about 1 year ago)
- Last Synced: 2025-05-17T17:11:14.501Z (about 1 year ago)
- Topics: api-integration, desktop-application, gui, openweathermap, portfolio-project, python, tkinter, weather-app
- Language: Python
- Homepage:
- Size: 3.98 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π¦οΈ Weather App (Python + Tkinter)




A beautiful, lightweight desktop app that shows the current weather for any city worldwide.
Built with Python, Tkinter GUI, and OpenWeatherMap API.
---
## β¨ Features
- π Select a country (with flag emojis!)
- ποΈ Select or type a city (auto-suggests cities for the chosen country)
- βοΈ Displays:
- Temperature
- Feels like
- Weather description (with emojis)
- Humidity
- Wind Speed
- π Refresh button with a **10-minute cooldown** and live countdown timer
- π§ Settings menu to **toggle temperature units** and **dark mode**
- β‘ Loads the OpenWeatherMap city list dynamically at startup
- π‘οΈ API key hidden using `.env` file for security
- π **Offline Mode**: Cache the last successful weather fetch for offline viewing
- ποΈ **Search History**: Quickly access recently viewed cities
- π **Multi-language Support**: Switch between English and Dutch dynamically
---
## π οΈ Architecture
The project is organized as follows:
```
weather_app/ # Project root
βββ city.list.json # Bulk city data for auto-suggestions
βββ weather_app.py # Main application script (GUI + logic)
βββ .env # Stores your OpenWeatherMap API key
βββ weather_cache.json # Cached weather data for offline mode
βββ settings.json # User preferences (default city, units, theme)
βββ requirements.txt # Python dependencies
```
### Key Components
- **`weather_app.py`**: Contains modular functions for data loading, API interaction, UI rendering, and state management.
- **`city.list.json`**: Dynamically loaded at runtime to populate country and city selectors.
- **`.env`**: Secures your API key via the `python-dotenv` package.
---
## π» Tech Stack
- **Language:** Python 3.8+
- **GUI Framework:** Tkinter
- **HTTP Client:** `requests`
- **Environment Management:** `python-dotenv`
- **Image Handling:** `Pillow`
- **Data Sources:** OpenWeatherMap API
---
## π Getting Started
### 1. Clone the repository
```bash
git clone https://github.com/your-username/weather-app.git
cd weather-app
```
### 2. Install requirements
```bash
pip install -r requirements.txt
```
### 3. Setup your `.env`
Create a `.env` file in the project root:
```plaintext
API_KEY=your_openweathermap_api_key_here
```
(You can get a free API key at [OpenWeatherMap](https://openweathermap.org/api))
### 4. Make sure you have `city.list.json`
Download the `city.list.json` from OpenWeatherMap bulk data:
π [http://bulk.openweathermap.org/sample/](http://bulk.openweathermap.org/sample/)
Place it inside the project folder.
---
## π₯οΈ Running the App
```bash
python weather_app_gui.py
```
---
## π¦ Built With
- [Python](https://www.python.org/)
- [Tkinter](https://wiki.python.org/moin/TkInter)
- [OpenWeatherMap API](https://openweathermap.org/api)
---
## π License
This project is licensed under the MIT License.
See the [LICENSE](LICENSE) file for details.
---
## π· Screenshots
*Soonβ’*
---
## π Credits
Built by **Bradley Davies** β€οΈ