The Lima Air Quality project is designed to collect, process, store, and analyze air quality data in Lima, Peru. By leveraging AWS cloud services, the system ensures scalability, reliability, and real-time monitoring.
This project consists of three main components:
- Database: Stores structured air quality data collected from various sensors.
- Data Pipeline: Automates the collection, formatting, and storage of air quality data.
- Dashboard: Provides visual insights into air quality trends and historical data.
The dashboard provides interactive visualizations into the air quality trends in Lima. It connects to the database and displays metrics such as historical trends, real-time sensor information.
You can access the live dashboard here.
The database is hosted on AWS RDS (MySQL) and is responsible for storing all air quality data. It consists of tables that keep track of sensor locations and recorded measurements.
Key Tables:
- Places: Stores information about the locations where air quality sensors are placed. Each entry includes details such as country, city, sensor ID, district, URL, geographical coordinates, and data source.
- Air: Records air quality measurements collected by the sensors. Each entry includes the sensor ID, date, and various pollutant levels such as CO, NO₂, O₃, PM10, PM2.5, SO₂, humidity, pressure, and temperature.
- Metric Description: Provides descriptions for the various metrics recorded in the air quality measurements, detailing what each metric represents.
The data pipeline is responsible for automating data ingestion, formatting, and storage. It retrieves air quality data from the World Air Quality Index (WAQI) API, formats it, and inserts it into the database.
- Data Retrieval: Fetches real-time air quality data via API.
- Data Formatting: Structures and formatting the data.
- Data Storage: Inserts formatted data into the database.
git clone https://github.com/haroldeustaquio/Air-Quality-Lima
cd lima-air-quality
pip install -r requirements.txt
Create a .env
file in the root directory and add the following credentials:
DB_HOST=your-db-host
DB_NAME=your-db-name
DB_USER=your-db-user
DB_PASSWORD=your-db-password
API_KEY=your-waqi-api-key