Skip to main content

Package for fetching and analyzing air quality data from multiple sources

Project description

Vayuayan Logo

Vayuayan

Vayuayan is a comprehensive Python package for fetching and analysing air quality data from multiple sources worldwide:

Installation

Install from PyPI (recommended):

pip install vayuayan

Install development version from GitHub:

pip install git+https://github.com/saketlab/vayuayan.git

Or install from source:

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

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"

# 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()

# Satellite PM2.5 analysis
pm25 = PM25Client()
# 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

Contributions are welcome! Please feel free to submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This package is not officially affiliated with any government agency or air quality monitoring network. It's a third-party tool for accessing publicly available environmental data. Users are responsible for verifying data accuracy and following proper attribution guidelines.

Etymology

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

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

Together, "Vayuayan" means "the path of wind" - representing the journey and movement of air quality data across space and time.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vayuayan-0.1.2.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vayuayan-0.1.2-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file vayuayan-0.1.2.tar.gz.

File metadata

  • Download URL: vayuayan-0.1.2.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for vayuayan-0.1.2.tar.gz
Algorithm Hash digest
SHA256 640521607f666a9f10a9bbe3c8adc720c2b0d216b4eda7efe91215b4fc887bee
MD5 6088aa7382667376868052a03b6e0787
BLAKE2b-256 1c901822263fdc29be5aca87eeb7f6af5e11932d0205206087f2bef8d42c92a8

See more details on using hashes here.

File details

Details for the file vayuayan-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vayuayan-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for vayuayan-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7301d8de6b077e149b7dc70af963babec85a68e7a94f9af0f6c031083cbbf59
MD5 c416d9c1d9ac4aebc3b0baf01a215014
BLAKE2b-256 ce3d3d41b5c89aa4f65ed95737fb30bc38eb2f3972f78d568afe505e9ec9f4e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page