About this project

## Overview India Air Quality & Weather Tracker is a fully automated data pipeline that collects live air quality and weather data for 8 major Indian cities (Bangalore, Mumbai, New Delhi, Gorakhpur, Chennai, Hyderabad, Pune, Kolkata) using the free Open-Meteo API. It stores historical records in a SQLite database and powers an interactive dashboard built with Streamlit and Plotly. The pipeline runs automatically every hour via GitHub Actions, requiring no manual intervention or API keys. ## Features - **Live Monitoring**: Real-time AQI and weather for 8 Indian cities. - **Auto-Updates**: Hourly refresh via GitHub Actions—no server needed. - **Historical Storage**: Every reading persisted to SQLite. - **Interactive Dashboard**: Built with Streamlit and Plotly for trend analysis. - **Trend Analysis**: PM2.5, temperature, and AQI trends over time. - **Fully Automated**: End-to-end pipeline with zero manual work. - **No API Key Needed**: Uses the free Open-Meteo API. ## Architecture The project consists of three main components: 1. **Backfill Historical Data** (`scripts/backfill_history.py`): One-time script that downloads 30 days of hourly historical AQI and weather data for all cities and stores it in SQLite. 2. **Automatic Hourly Updates** (`scripts/fetch_latest.py`): Fetches the latest readings, appends them to the SQLite database, and commits the updated database back to GitHub. Triggered by a GitHub Actions scheduler. 3. **Interactive Dashboard** (`dashboard/app.py`): Reads from the SQLite database and provides current snapshots, historical trends, PM2.5 analysis, average AQI comparisons, and temperature vs PM2.5 relationships with interactive Plotly visualizations. ## Tech Stack - **Language**: Python - **Data Handling**: Pandas, Requests - **Storage**: SQLite - **Dashboard**: Streamlit, Plotly - **Automation**: GitHub Actions - **Data Source**: Open-Meteo API ## Getting Started 1. Clone the repository. 2. Install dependencies with `pip install -r requirements.txt`. 3. Run `python scripts/backfill_history.py` to create the database with 30 days of historical data. 4. Launch the dashboard with `streamlit run dashboard/app.py`. 5. Enable the GitHub Actions workflow to automate hourly updates. 6. Deploy to Streamlit Community Cloud using `dashboard/app.py` as the entry point. ## Why It Stands Out This project demonstrates a complete end-to-end data pipeline—collecting live data from real-world APIs, automating ingestion with GitHub Actions, storing historical records in SQLite, and visualizing insights through an interactive dashboard. It simulates a production-style analytics workflow rather than a one-time static analysis. ## Future Improvements - Support for 100+ Indian cities - PostgreSQL integration - Docker containerization - AQI alert notifications via Email/SMS - Machine Learning-based AQI forecasting - REST API for external integrations