A Python GUI application that scrapes and visualizes historical weather data from Environment Canada's climate data portal for Winnipeg weather station. The application retrieves daily temperature records dating back to 1840 and provides tools for data analysis and visualization.
- Scrapes historical temperature data from Environment Canada's climate database
- Stores data in a local SQLite database using a context manager pattern
- Creates interactive visualizations with matplotlib:
- Monthly temperature distribution plots
- Historical temperature trend analysis
- Daily temperature comparisons
- Modular architecture with separate components for:
- Web scraping (scrape_weather.py)
- Database operations (db_operations.py)
- Data visualization (plot_operations.py)
- GUI interface (weather_gui.py)
weather_gui.py: Main GUI applicationweather_processor.py: Core data processing logicscrape_weather.py: Web scraping functionalitydb_operations.py: Database interaction layerplot_operations.py: Data visualizationdbcm.py: Database context manager
- Python 3.10 or higher
- wxPython >= 4.1.0
- matplotlib >= 3.5.0
- sqlite3 (built into Python)
- requests >= 2.26.0 (for web scraping)
- Clone the repository
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
.\venv\Scripts\activate # Windows- Install dependencies:
pip install wxPython>=4.1.0 matplotlib>=3.5.0 requests>=2.26.0- Run the application:
python weather_gui.py- Download the latest WeatherScraperApp installer
- Run the installer and follow the prompts
- Launch via desktop shortcut or start menu
-
Fetch Data:
- Click "Scrape Data" to download historical weather data
- Choose between full historical download or updates only
-
Visualize Data:
- Generate monthly temperature distribution plots
- View historical temperature trends
- Compare daily temperatures across years
-
Database Management:
- Data automatically saved to SQLite database
- Updates merge with existing records
- Built-in database integrity checks