aqicalc


Nameaqicalc JSON
Version 0.0.8.1 PyPI version JSON
download
home_pagehttps://github.com/ambeelabs/aqicalc
SummaryA library to convert between AQI value and pollutant concentration (µg/m³ or ppm)
upload_time2023-01-17 13:08:16
maintainer
docs_urlNone
authorAmbee
requires_python
licenseBSD 3-Clause
keywords air quality pm2.5 epa mep cpcb
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            #################################################################################
aqicalc
#################################################################################


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)
* Central Pollution Control Board (CPCB) India


Forked from python-aqi library

Changes from the original library
=================================
* Added CPCB AQI Calculation
* Added IEMA Brazil AQI Calculation
* Added Kuwait AQI
* Added Unit Conversion Functions
* Added Exception Handling (returns the number or NaN back if it can't convert)

.. image:: http://img.shields.io/badge/license-BSD%203--Clause-blue.svg
    :target: http://opensource.org/licenses/BSD-3-Clause
    :alt: license BSD 3-Clause


Install
=======

::

    $ pip install aqicalc


Usage
=====

Library
-------
NOTE: Different standards use different units for calculating AQI, use the appropriate units to get correct results. Examples for getting the units for each standards as well as unit conversion is avaiable (examples soon!)

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

    import aqicalc as 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 aqicalc as 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 aqicalc as aqi
    mycc = aqi.to_cc(aqi.POLLUTANT_PM25, '22', algo=aqi.ALGO_EPA)


Command line
------------

List supported algorithms and pollutants::

    $ aqi -l
    aqi.algos.epa: pm10 (µg/m³), o3_8h (ppm), co_8h (ppm), no2_1h (ppb), o3_1h (ppm), so2_1h (ppb), pm25 (µg/m³)
    aqi.algos.mep: no2_24h (µg/m³), so2_24h (µg/m³), no2_1h (µg/m³), pm10 (µg/m³), o3_1h (µg/m³), o3_8h (µg/m³), so2_1h (µg/m³), co_1h (mg/m³), pm25 (µg/m³), co_24h (mg/m³)

Convert PM2.5 to IAQI using EPA algorithm::

    $ aqi aqi.algos.epa pm25:12
    50

Convert PM2.5 to IAQI using EPA algorithm (full length)::

    $ aqi -c aqi aqi.algos.epa pm25:12
    50

Convert pollutants concentrations to AQI using EPA algorithm::

    $ aqi aqi.algos.epa pm25:40.9 o3_8h:0.077 co_1h:8.4
    114

Convert pollutants concentrations to AQI using EPA algorithm, display IAQIs::

    $ aqi -v aqi.algos.epa pm25:40.9 o3_8h:0.077 co_1h:8.4
    pm25:102 o3_8h:104 co_1h:90
    114

Convert PM2.5 IAQI to concentration using EPA algorithm::

    $ aqi -c cc aqi.algos.epa pm25:39
    pm2.5:9.3


Development
===========

To install the development environment::

    $ pip install -r dev_requirements.txt


Test
====

Test the package::

    $ python -m unittest discover

Automatic testing in various environments::

    $ tox


Release
=======

Use `bumpr` to release the package::

    $ bumpr -b -m


Project
=======
*  `Source code on github <https://github.com/ambeelabs/aqicalc>`_
* `Forked from python-aqi <https://github.com/hrbonz/python-aqi>`_



Resources
=========

* EPA AQI: Technical Assistance Document for the Reporting of Daily Air
  Quality – the Air Quality Index (AQI) December 2013) found at http://www.epa.gov/airnow/aqi-technical-assistance-document-dec2013.pdf
* National Ambient Air Quality Standards for Particulate Matter found at http://www.gpo.gov/fdsys/pkg/FR-2013-01-15/pdf/2012-30946.pdf
* MEP AQI:

    * GB3095—2012 (2012/02/29) found at http://www.mep.gov.cn/gkml/hbb/bwj/201203/t20120302_224147.htm
    * HJ633-2012 (2012/02/29) found at http://www.zzemc.cn/em_aw/Content/HJ633-2012.pdf
* CPCB AQI:
    * https://app.cpcbccr.com/ccr_docs/About_AQI.pdf
* IEMA AQI: https://iema.es.gov.br/Media/iema/CQAI/Cartilha/Guia_Qualidade_Ar_ebook.pdf
    * https://iema.es.gov.br/qualidadedoar/indicedequalidadedoar
* Kuwait AQI : https://enterprise.emisk.org/eMISKAirQuality/#/KAQI
* CAQI : https://www.airqualitynow.eu/download/CITEAIR-Comparing_Urban_Air_Quality_across_Borders.pdf
  


License
=======

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ambeelabs/aqicalc",
    "name": "aqicalc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "air quality pm2.5 EPA MEP CPCB",
    "author": "Ambee",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/17/46/8469fa89075ab91afd46682326b623d2541d4d2aa05cf6f088d59934140b/aqicalc-0.0.8.1.tar.gz",
    "platform": null,
    "description": "#################################################################################\naqicalc\n#################################################################################\n\n\nA library to convert between AQI value and pollutant concentration\n(\u00b5g/m\u00b3 or ppm) using the following algorithms:\n\n* United States Environmental Protection Agency (EPA)\n* China Ministry of Environmental Protection (MEP)\n* Central Pollution Control Board (CPCB) India\n\n\nForked from python-aqi library\n\nChanges from the original library\n=================================\n* Added CPCB AQI Calculation\n* Added IEMA Brazil AQI Calculation\n* Added Kuwait AQI\n* Added Unit Conversion Functions\n* Added Exception Handling (returns the number or NaN back if it can't convert)\n\n.. image:: http://img.shields.io/badge/license-BSD%203--Clause-blue.svg\n    :target: http://opensource.org/licenses/BSD-3-Clause\n    :alt: license BSD 3-Clause\n\n\nInstall\n=======\n\n::\n\n    $ pip install aqicalc\n\n\nUsage\n=====\n\nLibrary\n-------\nNOTE: Different standards use different units for calculating AQI, use the appropriate units to get correct results. Examples for getting the units for each standards as well as unit conversion is avaiable (examples soon!)\n\nConvert a pollutant to its IAQI (Intermediate Air Quality Index)::\n\n    import aqicalc as aqi\n    myaqi = aqi.to_iaqi(aqi.POLLUTANT_PM25, '12', algo=aqi.ALGO_EPA)\n\nGet an AQI out of several pollutant concentrations, default algorithm is EPA::\n\n    import aqicalc as aqi\n    myaqi = aqi.to_aqi([\n        (aqi.POLLUTANT_PM25, '12'),\n        (aqi.POLLUTANT_PM10, '24'),\n        (aqi.POLLUTANT_O3_8H, '0.087')\n    ])\n\nConvert an IAQI to its pollutant concentration::\n\n    import aqicalc as aqi\n    mycc = aqi.to_cc(aqi.POLLUTANT_PM25, '22', algo=aqi.ALGO_EPA)\n\n\nCommand line\n------------\n\nList supported algorithms and pollutants::\n\n    $ aqi -l\n    aqi.algos.epa: pm10 (\u00b5g/m\u00b3), o3_8h (ppm), co_8h (ppm), no2_1h (ppb), o3_1h (ppm), so2_1h (ppb), pm25 (\u00b5g/m\u00b3)\n    aqi.algos.mep: no2_24h (\u00b5g/m\u00b3), so2_24h (\u00b5g/m\u00b3), no2_1h (\u00b5g/m\u00b3), pm10 (\u00b5g/m\u00b3), o3_1h (\u00b5g/m\u00b3), o3_8h (\u00b5g/m\u00b3), so2_1h (\u00b5g/m\u00b3), co_1h (mg/m\u00b3), pm25 (\u00b5g/m\u00b3), co_24h (mg/m\u00b3)\n\nConvert PM2.5 to IAQI using EPA algorithm::\n\n    $ aqi aqi.algos.epa pm25:12\n    50\n\nConvert PM2.5 to IAQI using EPA algorithm (full length)::\n\n    $ aqi -c aqi aqi.algos.epa pm25:12\n    50\n\nConvert pollutants concentrations to AQI using EPA algorithm::\n\n    $ aqi aqi.algos.epa pm25:40.9 o3_8h:0.077 co_1h:8.4\n    114\n\nConvert pollutants concentrations to AQI using EPA algorithm, display IAQIs::\n\n    $ aqi -v aqi.algos.epa pm25:40.9 o3_8h:0.077 co_1h:8.4\n    pm25:102 o3_8h:104 co_1h:90\n    114\n\nConvert PM2.5 IAQI to concentration using EPA algorithm::\n\n    $ aqi -c cc aqi.algos.epa pm25:39\n    pm2.5:9.3\n\n\nDevelopment\n===========\n\nTo install the development environment::\n\n    $ pip install -r dev_requirements.txt\n\n\nTest\n====\n\nTest the package::\n\n    $ python -m unittest discover\n\nAutomatic testing in various environments::\n\n    $ tox\n\n\nRelease\n=======\n\nUse `bumpr` to release the package::\n\n    $ bumpr -b -m\n\n\nProject\n=======\n*  `Source code on github <https://github.com/ambeelabs/aqicalc>`_\n* `Forked from python-aqi <https://github.com/hrbonz/python-aqi>`_\n\n\n\nResources\n=========\n\n* EPA AQI: Technical Assistance Document for the Reporting of Daily Air\n  Quality \u2013 the Air Quality Index (AQI) December 2013) found at http://www.epa.gov/airnow/aqi-technical-assistance-document-dec2013.pdf\n* National Ambient Air Quality Standards for Particulate Matter found at http://www.gpo.gov/fdsys/pkg/FR-2013-01-15/pdf/2012-30946.pdf\n* MEP AQI:\n\n    * GB3095\u20142012 (2012/02/29) found at http://www.mep.gov.cn/gkml/hbb/bwj/201203/t20120302_224147.htm\n    * HJ633-2012 (2012/02/29) found at http://www.zzemc.cn/em_aw/Content/HJ633-2012.pdf\n* CPCB AQI:\n    * https://app.cpcbccr.com/ccr_docs/About_AQI.pdf\n* IEMA AQI: https://iema.es.gov.br/Media/iema/CQAI/Cartilha/Guia_Qualidade_Ar_ebook.pdf\n    * https://iema.es.gov.br/qualidadedoar/indicedequalidadedoar\n* Kuwait AQI : https://enterprise.emisk.org/eMISKAirQuality/#/KAQI\n* CAQI : https://www.airqualitynow.eu/download/CITEAIR-Comparing_Urban_Air_Quality_across_Borders.pdf\n  \n\n\nLicense\n=======\n\naqicalc is published under a BSD 3-clause license, see the LICENSE file\ndistributed with the project.\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause",
    "summary": "A library to convert between AQI value and pollutant concentration (\u00b5g/m\u00b3 or ppm)",
    "version": "0.0.8.1",
    "split_keywords": [
        "air",
        "quality",
        "pm2.5",
        "epa",
        "mep",
        "cpcb"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4948aa0148956b1c4d9e9fd0a065520455db7d62dab758db7029325523e95a83",
                "md5": "b0de412e965d83a1e1f7f5f8149158f1",
                "sha256": "12d3b97a0d9de2b6d1c973f47c6e26b19e2cc8b63ae9ff8dc614c7ed1ac92c65"
            },
            "downloads": -1,
            "filename": "aqicalc-0.0.8.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b0de412e965d83a1e1f7f5f8149158f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13427,
            "upload_time": "2023-01-17T13:08:14",
            "upload_time_iso_8601": "2023-01-17T13:08:14.140931Z",
            "url": "https://files.pythonhosted.org/packages/49/48/aa0148956b1c4d9e9fd0a065520455db7d62dab758db7029325523e95a83/aqicalc-0.0.8.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "17468469fa89075ab91afd46682326b623d2541d4d2aa05cf6f088d59934140b",
                "md5": "5b7b1d8af27c3e2ed2d42e26c6b336fe",
                "sha256": "bf8c43fc20b4c0d610ecc0dff1f4ba301e9bf91460b4cab0eac51b61a25af24b"
            },
            "downloads": -1,
            "filename": "aqicalc-0.0.8.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5b7b1d8af27c3e2ed2d42e26c6b336fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12510,
            "upload_time": "2023-01-17T13:08:16",
            "upload_time_iso_8601": "2023-01-17T13:08:16.600860Z",
            "url": "https://files.pythonhosted.org/packages/17/46/8469fa89075ab91afd46682326b623d2541d4d2aa05cf6f088d59934140b/aqicalc-0.0.8.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-17 13:08:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ambeelabs",
    "github_project": "aqicalc",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "aqicalc"
}
        
Elapsed time: 0.07839s