Python Weather Dashboard
PROJECT REPORT
Submitted by:
ACHEEV DHAKAR
Reg No: 25BCE11128
Computer Science & Engineering
Date: 24 November 2025
Abstract: This report documents the creation of a Weather Dashboard
application developed using Python. The application utilizes the
OpenWeatherMap API for fetching real-time weather data and employs the
Tkinter library to construct the Graphical User Interface (GUI). Furthermore,
the Pillow library is integrated for handling dynamic image processing. The
resulting system offers a full-screen, visually captivating user experience that
dynamically adjusts its display based on the prevailing weather conditions.
1 Introduction
The Python Weather Dashboard is a desktop application designed to deliver real-time weather
information through a visually appealing Graphical User Interface (GUI). Instead of conventional
text reports, it displays weather data on a "card" overlay and dynamically updates the
application's background image to reflect the current weather conditions (e.g., showing a rainy
background during rainfall).
This project relies on the OpenWeatherMap API for fetching live data. It utilizes Python's Tkinter
library to build the interface and the Pillow (PIL) library for advanced image processing capabilities.
2 Problem Statement
Raw meteorological data, presented typically as unengaging numbers and text, often proves
difficult for users to quickly interpret and visualize. Existing weather websites frequently
necessitate navigating through complex menus. This project addresses this need by creating a
minimalist, full-screen visual dashboard. The goal is to provide immediate weather context using
dynamic visual cues (backgrounds) paired with precise meteorological data, streamlining the user
experience.3 Functional Requirements
3 The system must satisfy the following core functions:
Requirement Description
User Input The system must accept a city name from the user
via a straightforward input dialog.
Data Retrieval Real-time weather data must be fetched from the
OpenWeatherMap API in JSON format using a valid
API key.
Data Parsing The application needs to accurately extract key data
points: Temperature, Humidity, Wind Speed,
Weather Description, and the Weather ID.
Dynamic Visualization The system must analyze the "Weather ID" to
categorize the weather (e.g., Clear, Rain, Snow) and
dynamically change the background image to
match.
Error Handling User-friendly error messages must be displayed as
pop-ups for critical issues, such as "City Not Found"
or a "Connection Error."
1
4 Non-functional Requirements
- Usability: The interface is designed as a full-screen application to minimize distractions
and focus solely on the data.
- Performance: Background images must be resized efficiently using high-quality
resampling filters (LANCZOS) to fit the user’s screen resolution without pixelation.
- Reliability: The application includes exception handling to prevent crashes during network
timeouts or invalid API responses.
-
5 System Architecture
The program follows a modular
architecture where the Frontend
(GUI) is decoupled from the
Backend (Logic) and External
Services. The flow is linear:
1. Initialization: The main()
function triggers the
application.
2. User Input:
get_city_prompt() captures
the target city.
3. API Request:
get_weather(city) constructs
the URL and sends an HTTP
GET request.
4. Logic Processing: Data is
parsed, and the Weather ID is mapped to a specific image filename.
5. GUI Rendering: The GUI() function builds the window, resizes the image using PIL, and
places text widgets.
2
6 Design Diagrams
6.1 A. Use Case Diagram
The following diagram illustrates the interactions between the User and the System
functionalities.
6.2 B. Workflow Diagram
The flow of logic from start to finish.
6.3 C. Sequence Diagram
The chronological sequence of messages between the User, System, and API.
7Design Decisions and Technical Justification
The following core technologies were selected to meet the project's requirements for simplicity, performance,
and flexibility:
● Programming Language: Python
○ Rationale: Chosen for its straightforward syntax and extensive ecosystem of powerful
libraries, which simplify both API interactions and Graphical User Interface (GUI) development.
● GUI Framework: Tkinter
○ Rationale: Preferred over third-party frameworks because it is a native component of the
Python standard library. It offers sufficient functionality for creating the required lightweight,
desktop-based GUI.
● HTTP Communication: Requests Library
○ Rationale: Used for making network (HTTP) calls. It streamlines the process of sending
complex headers and parameters, providing a much cleaner and simpler interface compared to
the standard urllib module.
3
● Image Handling: Pillow (PIL)
○ Rationale: This library is critical for the dashboard's core functionality. Standard Tkinter lacks
the capability to dynamically resize images based on changes in screen dimensions
(width/height), which is a non-negotiable requirement for the responsive design.
8 Implementation Details
TThe application is built with a modular structure in Python, utilizing the following functions:
● get_city_prompt(): Uses simpledialog to capture user input for the city name in a clean
manner.
● get_weather(city_name):
○ Constructs the necessary query URL using BASE_URL and API_KEY.
○ Includes a try...except block to manage potential network issues, specifically catching
[Link] and ConnectionError.
○ Extracts the unique Weather ID (e.g., 500 for Rain) to drive the visual logic of the GUI.
● GUI(...):
○ Initializes the main application window as a full-screen [Link]() instance.
○ Implements custom logic to group the API's extensive list of 50+ weather codes (e.g., IDs
500-531 are mapped to the simplified "Rainy" category).
4
Figure 3: Workflow Activity Diagram
5
- Uses [Link]((screen_width, screen_height)) to ensure the background covers the
whole screen regardless of monitor size.
9 Screenshots / Results
10 Testing Approach
The application underwent the following testing strategies:
6
Testing Summary:
● Unit Testing: Verified the accuracy of the get_weather function by testing it with established cities
(e.g., London, New York).
● Boundary Testing: Ensured graceful error handling (specifically "404 City Not Found" responses) by
testing the input prompt with various invalid inputs, including empty strings, numerical values, and
nonsensical text.
7
-
- Network Failure Testing: Disconnected the system from the internet to verify that the
[Link] block triggers the correct error popup.
11 Challenges Faced
Image Resizing: Originally, images were static and failed to fit different monitors. This necessitated...
8
- Dynamic Image Handling & Resolution: Image resizing was made dynamic and efficient by
integrating the PIL library. This allows the application to detect the current screen resolution
([Link]\_screenwidth) and resize images on the fly to fit the display.
-
- Simplified Weather ID Mapping: To avoid the inefficiency of creating images for all 50+ specific
weather codes provided by the API (e.g., light rain, heavy rain), a solution was implemented. Logic
was developed to group these IDs into broader categories (e.g., all 500-level codes are mapped to
a single "Rainy" image), simplifying the mapping process.
12 Enhancements Future
Here are the planned feature expansions for the weather application:
● 5-Day Forecast: Enhance the API call to retrieve and display extended forecast data, moving beyond
just current weather conditions.
● GPS Integration: Implement automatic location detection using the user's IP address, eliminating the
need for manual location input.
● Search History: Incorporate a feature to save recently searched cities, allowing users quick access to
their preferred locations.
13 References
1. OpenWeatherMap API Docs: [Link]
2. Python Requests Library: [Link]
3. Tkinter Documentation: [Link]
4. Pillow (PIL) Handbook: [Link]