Skip to content

Tkinter weather app using OpenWeather API, current conditions, 5-day forecast, and 3-hour detail view.

Notifications You must be signed in to change notification settings

Myszanik/WeatherApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather App

This repository contains a simple Weather application built using Python, tkinter, and the OpenWeather API. The app lets you search for a city and displays current weather plus a 5-day forecast, you can also click a day to view the forecast in 3-hour intervals.

Overview

The Weather App provides a GUI where you can:

  • Search a location by name
  • View current conditions (temperature, humidity, wind, visibility, sunrise, sunset, chance of rain)
  • View a 5-day forecast
  • Click a forecast day to open a detailed screen with 3-hour interval data
  • Move between forecast days using Next Day, Previous Day buttons

Features

  • Current Weather

    • Temperature
    • Condition description and icon
    • Humidity
    • Wind speed
    • Visibility
    • Min and max temperature
    • Sunrise and sunset
    • Chance of rain (when available)
  • 5-Day Forecast

    • Forecast cards for the next 5 days
    • Weather icons and midday temperatures
  • Detailed Forecast View

    • 3-hour interval breakdown for a selected day
    • Navigation between available forecast days

Requirements

  • Python 3.x
  • tkinter (usually comes pre-installed with Python)
  • OpenWeather API key (free tier is enough)

Python packages (installed via requirements.txt):

  • requests
  • python-dotenv
  • Pillow

Setup (Windows, PowerShell)

  1. Clone the repository
    git clone https://github.com/Myszanik/WeatherApp.git
  2. Navigate to the Project Directory:
    cd WeatherApp
  3. Create a virtual environment (recommended):
    python -m venv .venv
    .\.venv\Scripts\Activate.ps1
  4. Install Dependencies:
    python -m pip install -r requirements.txt
  5. Add your OpenWeather API key:
    • Create a file named .env in the same folder as WeatherApp.py, then put this line inside it
    api_key=YOUR_OPENWEATHER_API_KEY
  6. Run the Application:
    python WeatherApp.py
    

Notes

  • The .env file is intentionally not included in the repository, each user must create their own to run the app.
  • If you make the repo public, your API key stays safe as long as .env is not committed.

Screenshots

Main screen (current weather + 5-day forecast)

Main screen

3-hour forecast view (selected day)

3-hour forecast

Acknowledgements

  • tkinter, for the GUI
  • OpenWeather API, for weather data
  • requests, for HTTP requests
  • python-dotenv, for loading environment variables from .env
  • Pillow, for displaying weather icons

Status

This project is for learning and practice. Improvements and clean-ups are welcome.

About

Tkinter weather app using OpenWeather API, current conditions, 5-day forecast, and 3-hour detail view.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages