Skip to content

A desktop weather application built with Python and Tkinter that fetches real-time weather data using the OpenWeatherMap API. Implements geolocation, timezone handling, and a five-day forecast using external Python libraries. Ideal for learning GUI development, API integration, and object-oriented programming.

Notifications You must be signed in to change notification settings

Haseeb-code1/WeatherApp-Tkinter-Pytho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WeatherApp-Tkinter-Python

🌦️ Overview

This is a desktop weather application developed in Python using the Tkinter GUI framework. It fetches real-time weather and forecast data from the OpenWeatherMap API and displays it in an intuitive graphical interface. The app demonstrates the integration of external APIs, geolocation handling, timezone management, and object-oriented design in Python.

πŸ”§ Features

Search for any city to get current weather data

Display temperature, humidity, wind speed, pressure, and condition

Five-day weather forecast

Automatic timezone detection based on city

Error handling for invalid input and network issues

πŸ› οΈ Technologies Used

Python 3.x

Tkinter – GUI development

OpenWeatherMap API – Weather data source

geopy – Geolocation (city to coordinates)

timezonefinder – Timezone detection

pytz – Timezone-aware datetime

requests – API requests

πŸš€ Getting Started

Prerequisites

Make sure you have Python 3 installed. Then install the required packages:

pip install geopy timezonefinder pytz requests

Run the App

Clone the repository and run the main script:

git clone https://github.com/Haseeb-code1/WeatherApp-Tkinter-Pytho.git cd WeatherApp-Tkinter-Pytho python weather_app.py

⚠️ Note: Replace weather_app.py with your actual Python script name.

πŸ” API Key Setup

Replace the placeholder API key in your script with your own OpenWeatherMap API key:

self.api_key = "YOUR_API_KEY"

Sign up for a free key at: https://openweathermap.org/api

πŸ–ΌοΈ Screenshots

image

πŸŽ“ Educational Value

This project helps you learn:

GUI development with Tkinter

API integration and JSON parsing

Object-Oriented Programming (OOP)

Working with external libraries in Python

Managing real-time data and handling errors

πŸ“ˆ Future Enhancements

Add hourly and radar forecasts

Add support for Celsius/Fahrenheit toggle

Mobile or web version using Kivy/React Native or Flask

Use charts for data visualization

πŸ§‘β€πŸ’» Author

Haseeb Tariq – GitHub

About

A desktop weather application built with Python and Tkinter that fetches real-time weather data using the OpenWeatherMap API. Implements geolocation, timezone handling, and a five-day forecast using external Python libraries. Ideal for learning GUI development, API integration, and object-oriented programming.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages