Skip to main content

Package to import air quality data from UK and European sites. Mirrors the functionality of the R package 'openair'.

Project description

PyAURN - latest-version

This is a Python port of functions of the openair R package. The openair R package relies on data provided as a set of .RData files on the Defra website, specifically designed for use by the openair project. This Python package relies on the same data, however imports it into a Python friendly pandas dataframe without the need for R by utilising the pyreadr package.

Getting started

Install the via pip:

pip install pyaurn

Example quickstart functions in the package as below:

from pyaurn import importAURN, importMeta, timeAverage

# Download metadata of site IDs, names, locations etc
metadata = importMeta()

# Download 4 years of data for the Marylebone Road site
# (MY1 is the site ID for this site)
# Note: range(2016, 2022) will produce a list of six years: 2016, 2017, 2018, 2019, 2020, and 2021. 
# Alternatively define a list of years to use eg. [2016,2017,2018,2019,2020,2021]
data = importAURN("MY1", range(2016, 2022))

# Group the DataFrame by a frequency of monthly, and the statistic mean(). 
data_monthly = timeAverage(data,avg_time="month",statistic="mean")

Current Functions

The following functions are currently available in the package:

  • importMeta - download meta information on the different sents for specified data source.
  • importAURN - import AURN data for a specified site and year(s).
  • importUKAQ - import UK Air Quality data for a specified site, year(s), and data source.
  • importEurope - import European Air Quality data for a specified site, year(s) - WIP (final dataframe format needs widening to clean pollutants)
  • timeAverage - time average the data to a specified frequency and statistic.

Future developments

  • integrate other openair functions
  • open to suggestions (please leave enhancement tag in Issues)

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

pyaurn-0.1.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

pyaurn-0.1.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyaurn-0.1.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyaurn-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cad759ba2b8aed1e7170e42d1a91ec61db54d7e47690fb59fccd23915ac47a98
MD5 6e438f21a8c1593434facc0429126ec3
BLAKE2b-256 18d9406b7a612950b7d8ef7cfb131e7963464bce6d9efeb88f6f6c2779bdc980

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyaurn-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyaurn-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 733a7bae58d4397024a6b28903bc7e18464c8458e6d56e0d59a07ff669501a86
MD5 f69ad20a76555ed67b44649581e03769
BLAKE2b-256 f531ced0258c4651ae1dcad5b92a14d13a7677ba6e1c87bad5e44fd8f541b945

See more details on using hashes here.

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