Skip to main content

Vayuayan Logo

Vayuayan

Vayuayan downloads and examines air quality data from three sources:

Vayuayan calculates the CPCB National Air Quality Index. It changes CPCB files into tidy (long) tables. It compares sensor data with the US EPA targets for PM2.5 sensors.

Installation

Install from PyPI (recommended):

pip install vayuayan

The plotting functions (plot_daily_record_*) need matplotlib: pip install "vayuayan[plot]".

Install the development version from GitHub:

pip install "git+https://github.com/saketlab/vayuayan.git#subdirectory=python"

Or install from the source code:

git clone https://github.com/saketlab/vayuayan.git
cd vayuayan/python
pip install -e .

Cache

Vayuayan keeps CPCB files of past years in ~/.cache/vayuayan. To use a different directory, set VAYUAYAN_CACHE_DIR.

Quick Start

Command Line Interface

# List available states/regions for AQI data
vayuayan list_states

# List cities in a state
vayuayan list_cities "Maharashtra"

# List monitoring stations in a city
vayuayan list_stations "Mumbai"

# Download historical city-level AQI data
vayuayan city_data --city "Mumbai" --year 2024 --path "mumbai_aqi_2024.csv"

# Download historical station-level data
vayuayan station_data --station_id "site_5964" --year 2024 --path "station_data_2024.csv"

# Compute the daily National AQI of a station from its raw 15-minute data
vayuayan daily_aqi --station_id "site_301" --year 2024 --path "daily_aqi.csv"

# Get your current location (IP-based)
vayuayan locate_me

# Find nearest monitoring station
vayuayan nearest_station --lat 19.0760 --lon 72.8777

# Get live air quality data
vayuayan live_aqi --station_id "site_5964" --path "live_data.json"

# Analyze PM2.5 satellite data for a region (combines all polygons)
vayuayan pm25 --geojson_path "delhi_ncr.geojson" --year 2023 --month 11

# Analyze PM2.5 data grouped by state
vayuayan pm25 --geojson_path "india_districts.geojson" --year 2023 --month 11 --group_by state_name

# Analyze PM2.5 data grouped by multiple columns (state and district)
vayuayan pm25 --geojson_path "india_districts.geojson" --year 2023 --month 11 --group_by state_name,district_name

Python API

from vayuayan import CPCBHistorical, CPCBLive, PM25Client

# Historical data client
historical = CPCBHistorical()
states = historical.get_state_list()
mumbai_stations = historical.get_station_list("Mumbai")

# Live monitoring client
live = CPCBLive()
location = live.get_system_location()
nearest_station = live.get_nearest_station(location)
current_aqi = live.get_live_aqi_data()

# National AQI from concentrations (24-hour averages; 8-hour for CO and O3)
from vayuayan import compute_aqi

compute_aqi({"PM2.5": 45, "PM10": 80, "NO2": 30})  # AQI 80, Satisfactory, PM10

# Daily AQI and tidy rows from raw CPCB data
daily = historical.daily_aqi("site_301", "2024")
rows = historical.download_raw_aqi_data_station_level("site_301", "2024", "", tidy=True)

# Satellite PM2.5 analysis (V6.GL.03 by default)
pm25 = PM25Client()
# Monthly statistics, and state statistics as a GeoDataFrame for a map
monthly = pm25.get_pm25_monthly_stats("delhi_ncr.geojson", 2023)
state_map = pm25.get_pm25_stats(
    "india_districts.geojson", 2023, 11, group_by="state_name", geometry=True
)
# Combined stats for entire region
delhi_stats = pm25.get_pm25_stats("delhi_ncr.geojson", 2023, 11)
# Stats grouped by state
state_stats = pm25.get_pm25_stats(
    "india_districts.geojson", 2023, 11, group_by="state_name"
)
# Stats grouped by multiple columns (state and district)
district_stats = pm25.get_pm25_stats(
    "india_districts.geojson", 2023, 11, group_by="state_name,district_name"
)

Contributing

We accept contributions. To contribute, open a pull request.

Disclaimer

This package has no official relation to a government agency or to an air quality monitoring network. It is a third-party tool for public environmental data. Users must make sure that the data is accurate. Users must also give the correct attribution.

Etymology

Vayuayan (वायुअयन) combines two Sanskrit words:

  • Vayu (वायु): Wind, air
  • Ayan (अयन): Path, journey, movement

Thus, "Vayuayan" means "the path of wind". The name refers to the movement of air quality data across space and time.

Metadata

Release files for vayuayan 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vayuayan 0.3.0
File Size Uploaded Provenance Actions
vayuayan-0.3.0.tar.gz 147.4 kB With provenance Details for vayuayan-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vayuayan 0.3.0
File Interpreter ABI Platform Actions
vayuayan-0.3.0-py3-none-any.whl Python 3 none any Details for vayuayan-0.3.0-py3-none-any.whl

Total release size: 273.7 kB

Release files / vayuayan-0.3.0.tar.gz

Download URL vayuayan-0.3.0.tar.gz
Size 147.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3a094be069e50268278f550adfce23df93fed1b30615f918faa251107e6cdcca
BLAKE2b-256 checksum
How to use checksums
bdf23b09a9fc746e56319643ca2f5fb7858ecfdae2e7771a2044abc42a966e5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / vayuayan-0.3.0-py3-none-any.whl

Download URL vayuayan-0.3.0-py3-none-any.whl
Size 126.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe2c0d20534cde3fed557c98f6a98d6e19852d005105de92b1b8018fa4c7dbb1
BLAKE2b-256 checksum
How to use checksums
d9e302dc522fcc4ffc25a149bce438b23ba3f7a56768d357fec32b7354b9b187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for vayuayan 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vayuayan-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page