Skip to main content

Package to import AURN air quality data from DEFRA UK AIR site

Project description

PyAURN - latest-version

This is a rework of the original function, utilising pyreadr instead of rpy2. This negates having a local installation of R, and therefore can remain a python only configuration.

This is a simple Python package to import data from the UK Automatic Urban Rural Network - an air pollution network run by the UK government.

This is a Python port of a couple of functions of the openair R package. This 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.

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")

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.0.8.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

pyaurn-0.0.8-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyaurn-0.0.8.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyaurn-0.0.8.tar.gz
Algorithm Hash digest
SHA256 a18e205aa86e6a9a669f440348e5277aaf386a45d0bac28581ea08ffc43eb6d0
MD5 1af6cd0d454fa794e56fb85066ccf34c
BLAKE2b-256 faca662df1f8c0de591235247572db557f8e1a27a00b7690b7a2e795d7d85dcb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyaurn-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyaurn-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3873612f2ac2998be253d1165fa5ec0a6d49f06008022eab29229f099b458f41
MD5 30c30cf95f6977588d5bcfccee768567
BLAKE2b-256 4f5c4b355fe57e062a80f7e5452615224dbcb6550010e96a73f0153e60ac9e2d

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