vayuayan: Collect and Analyze Air Quality and Pollution Data¶
A Python package for fetching and analysing air quality data from multiple sources worldwide:
Overview¶
vayuayan provides a simple and powerful interface to access pollution monitoring data from India’s Central Pollution Control Board and WUSTL ACAG. It supports:
Air Quality Index (AQI) data: Historical and real-time air quality measurements
PM2.5 data: Fine particulate matter data for any geographic region using GeoJSON
Live monitoring: Real-time air quality parameters for monitoring stations
Geolocation support: Automatic detection and nearest station finding
Quick Start¶
Installation¶
pip install vayuayan
Basic Usage¶
from vayuayan import CPCBHistorical, CPCBLive, PM25Client
# Initialize clients
aqi_client = CPCBHistorical()
live_client = CPCBLive()
pm25_client = PM25Client()
# Get available states
states = aqi_client.get_state_list()
print(states)
# Get live AQI data for your location
location = live_client.get_system_location()
nearest_station = live_client.get_nearest_station()
live_data = live_client.get_live_aqi_data()
Command Line Interface¶
# List available states
vayuayan list_states
# Get city data for Mumbai in 2024
vayuayan city_data --city "Mumbai" --year 2024 --path "mumbai_aqi.csv"
# Get live AQI data for your location
vayuayan live_aqi --path "current_aqi.json"
Jupyter Notebooks¶
Interactive notebooks with hands-on examples live in the notebooks/
directory: