Skip to main content

A library to convert between AQI value and pollutant concentration (µg/m³ or ppm)

Project description

A library to convert between AQI value and pollutant concentration (µg/m³ or ppm) using the following algorithms:

  • United States Environmental Protection Agency (EPA)

  • China Ministry of Environmental Protection (MEP)

https://travis-ci.org/hrbonz/python-aqi.svg?branch=master

Usage

Convert a pollutant to its IAQI (Intermediate Air Quality Index):

import aqi
myaqi = aqi.to_iaqi(aqi.POLLUTANT_PM25, '12', algo=aqi.ALGO_EPA)

Get an AQI out of several pollutant concentrations, default algorithm is EPA:

import aqi
myaqi = aqi.to_aqi([
    (aqi.POLLUTANT_PM25, '12'),
    (aqi.POLLUTANT_PM10, '24'),
    (aqi.POLLUTANT_O3_8H, '0.087')
])

Convert an IAQI to its pollutant concentration:

import aqi
mycc = aqi.to_cc(aqi.POLLUTANT_PM25, '22', algo=aqi.ALGO_EPA)

Resource

License

python-aqi is published under a BSD 3-clause license, see the LICENSE file distributed with the project.

Project details


Supported by

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