Skip to content

WeatherScope Pro: A sleek Python/ttkbootstrap weather dashboard. 🌀️ Fetches live OpenWeatherMap data. Features a dynamic gradient UI that changes with the weather, animated Meter widgets, interactive 24-hour & 5-day matplotlib forecast charts, and an embedded tkintermapview. Multi-threaded & cached for a smooth UX.

Notifications You must be signed in to change notification settings

Siddhu-Srinivas/OIBSIP_Python-Programming_task-4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

WeatherScope Pro - Modern Weather Dashboard

Objective

WeatherScope Pro is a sleek, interactive weather application designed to provide real-time weather data with an intuitive, modern user interface. The application delivers comprehensive weather information including current conditions, 24-hour forecasts, 5-day forecasts, and interactive maps through a professional desktop application.


Project Overview

Version: 9.1
Platform: Python (Desktop)
Theme: Light mode with dynamic gradient backgrounds
Key Features: Live weather data, interactive charts, visual meters, real-time clock, and map integration


Steps Performed

1. Architecture & Setup

  • Initialized a modern desktop application using ttkbootstrap for enhanced visual design
  • Configured API integration with OpenWeatherMap for real-time weather data
  • Implemented caching mechanism (300-second TTL) to optimize API calls
  • Set up threading for background data fetching to prevent UI freezing

2. UI/UX Design

  • Created a responsive, professional interface with a light theme (cosmo)
  • Implemented dynamic gradient backgrounds that adapt to weather conditions
  • Designed custom widgets including GradientFrame and ForecastCard for visual consistency
  • Applied modern typography using Segoe UI font family throughout the application
  • Added scrollable content areas for better data presentation

3. Core Features Development

  • Current Weather Tab: Displays real-time temperature, conditions, and visual meters for humidity, wind speed, pressure, and "feels like" temperature
  • Hourly Tab: 24-hour interactive forecast with temperature visualization and tooltips
  • 5-Day Forecast Tab: Daily high/low temperatures with visual cards and embedded charts
  • Map Tab: Interactive map with weather location markers using TkinterMapView

4. Data Processing

  • Implemented timezone offset calculations for accurate local time representation
  • Created forecast data processing to calculate daily min/max temperatures from 3-hour intervals
  • Developed hourly interpolation algorithm to generate smooth 24-hour forecasts
  • Built suggestion engine based on weather conditions and forecasts

5. Interactive Elements

  • Added live clock feature showing local time at the weather location
  • Implemented animated value transitions for temperature changes
  • Created clickable forecast cards that display detailed hourly breakdowns
  • Integrated matplotlib with optional mplcursors for interactive chart tooltips
  • Added hover effects on forecast cards for better user feedback

6. Performance Optimization

  • Implemented response caching to reduce API calls
  • Used threading for non-blocking API requests
  • Added loading overlay with visual feedback
  • Optimized matplotlib chart rendering for smooth animations

7. Error Handling & Validation

  • Added comprehensive error handling for network issues, invalid cities, and API errors
  • Implemented graceful degradation when optional libraries (matplotlib, mplcursors) are unavailable
  • Created user-friendly error messages and status indicators

Tools & Technologies Used

Category Tools
GUI Framework ttkbootstrap, tkinter
API Integration OpenWeatherMap API, requests library
Data Visualization matplotlib, mplcursors
Mapping tkintermapview
Data Processing Python datetime, collections.Counter
Concurrency threading
Font/Design Segoe UI, custom color palette (#0d6efd primary blue)

Required Libraries

tkinter (built-in)
ttkbootstrap
requests
tkintermapview
matplotlib (optional, for charts)
mplcursors (optional, for tooltips)

Installation & Setup

1. Install Dependencies

pip install requests tkintermapview ttkbootstrap matplotlib mplcursors

2. Get API Key

  • Visit OpenWeatherMap API
  • Sign up for a free account
  • Generate an API key from your account dashboard

3. Configure API Key

Replace YOUR_API_KEY_HERE in the script with your actual OpenWeatherMap API key:

API_KEY = "your_actual_api_key_here"

4. Run the Application

python weather_dashboard.py

Outcome & Key Achievements

βœ… Fully Functional Weather Dashboard - Real-time weather data from OpenWeatherMap
βœ… Professional UI/UX - Modern, responsive interface with dynamic themes
βœ… Multi-Tab Interface - Current, Hourly, 5-Day Forecast, and Map tabs
βœ… Interactive Visualizations - Charts, meters, and hover tooltips
βœ… Data Accuracy - Timezone-aware time calculations and local time display
βœ… Performance Optimized - Caching, threading, and efficient rendering
βœ… Error Resilience - Graceful handling of network and API errors
βœ… User-Friendly - Intuitive search, keyboard shortcuts (Ctrl+F), and status indicators


Usage Guide

Searching for Weather

  1. Enter a city name in the search box
  2. Press Enter or click the Search button
  3. Wait for data to load (watch the progress indicator)

Navigating Tabs

  • Current Tab: View real-time conditions and detailed weather meters
  • Hourly Tab: See temperature trends over the next 24 hours
  • 5-Day Tab: Plan ahead with daily forecasts; click any card for hourly details
  • Map Tab: View the weather location on an interactive map

Keyboard Shortcuts

  • Ctrl+F: Focus the search box for quick city search

Weather Suggestions

The app provides smart recommendations based on current conditions:

  • Rain alerts and umbrella reminders
  • Heat warnings during extreme temperatures
  • Wind advisories for outdoor activities
  • UV index warnings

File Structure

weather_dashboard.py          # Main application file (1000+ lines)
last_city.txt                 # Stores last searched city (auto-created)
README.md                     # This file

Customization

Changing Color Palette

Edit the PALETTE dictionary:

PALETTE = {
    'accent': '#0d6efd',           # Primary blue
    'accent_soft': '#cfe2ff',      # Light blue
    'muted': '#6b7280',            # Gray
    'card_bg': '#ffffff',          # White
    'glass': '#ffffffcc'           # Translucent white
}

Adjusting Cache Duration

Modify CACHE_TTL (in seconds):

CACHE_TTL = 300  # Current: 5 minutes

Known Limitations

  • Requires internet connection for API calls
  • Free tier OpenWeatherMap API has rate limits
  • Some features (charts) require matplotlib installation
  • Map functionality depends on internet connectivity for tile server

Future Enhancements

  • Multiple location comparison
  • Weather alerts and notifications
  • Historical weather data
  • Customizable dashboard widgets
  • Dark mode theme option
  • Mobile app version
  • Air quality and pollen data integration

Support & Troubleshooting

Issue: "API Key Missing" Error

Solution: Ensure you've replaced YOUR_API_KEY_HERE with a valid OpenWeatherMap API key

Issue: "Could not load map"

Solution: Check your internet connection; the map requires live tile data

Issue: Charts not displaying

Solution: Install matplotlib: pip install matplotlib

Issue: City not found

Solution: Try using the full city name or add the country code (e.g., "London, UK")


License & Attribution

  • OpenWeatherMap API: https://openweathermap.org
  • ttkbootstrap: Modern tkinter theme library
  • tkintermapview: Interactive map widget for tkinter

About

WeatherScope Pro: A sleek Python/ttkbootstrap weather dashboard. 🌀️ Fetches live OpenWeatherMap data. Features a dynamic gradient UI that changes with the weather, animated Meter widgets, interactive 24-hour & 5-day matplotlib forecast charts, and an embedded tkintermapview. Multi-threaded & cached for a smooth UX.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages