pyaro - Airquality Reader-interface for Observations
The library that solves the mystery of reading airquality measurement databases. (Pronunciation as in French: Poirot)
About
Pyaro is an interface which uses a simple access pattern to different air-pollution databases. The goal of pyro was threefold.
- A simple interface for different types of air-pollution databases
- A programmatic interface to these databases easily usable by large applications like PyAerocom
- Easy extension for air-pollution database providers or programmers giving the users (1. or 2.) direct access their databases without the need of a new API.
A few existing implementations of pyaro can be found at pyaro-readers.
Metadata
pyaro uses an extensible metadata-system similar to the netcdf-conventions. See Metadata.md.
Installation
Pyaro is available on pypi, typical installation is:
python -m pip install pyaro
To install specifically from github, use:
python -m pip install 'pyaro@git+https://github.com/metno/pyaro.git'
Both commands will install pyaro and all its dependencies (numpy).
Usage
import pyaro.timeseries
TEST_FILE = "csvReader_testdata.csv"
engines = pyaro.list_timeseries_engines()
# {'csv_timeseries': <pyaro.csvreader.CSVTimeseriesReader.CSVTimeseriesEngine object at 0x7fcbe67eab00>}
print(engines['csv_timeseries'].args)
# ('filename', 'columns', 'variable_units', 'csvreader_kwargs', 'filters')
print(pyaro.timeseries.filters.list)
# immutable dict of all filter-names to filter-classes
print(engines['csv_timeseries'].supported_filters())
# list of filter-classes supported by this reader
print(pyaro.timeseries.filters.list)
with engines['csv_timeseries'].open(
filename=TEST_FILE,
filters={'countries': {include=['NO']}}
) as ts:
for var in ts.variables():
# stations
ts.data(var).stations
# start_times
ts.data(var).start_times
# stop_times
ts.data(var).end_times
# latitudes
ts.data(var).latitudes
# longitudes
ts.data(var).longitudes
# altitudes
ts.data(var).altitudes
# values
ts.data(var).values
# flags
ts.data(var).flags
# if pandas is installed, data can be converted to a pandas Dataframe
df = pyaro.timeseries_data_to_pd(data)
Supported readers
- csv_timeseries Reader for all tables readable with the python csv module. The reader supports reading from a single local file, with csv-parameters added on the command-line.
Usage - csv_timeseries
import pyaro.timeseries
TEST_FILE = "csvReader_testdata.csv"
engine = pyaro.list_timeseries_engines()["csv_timeseries"]
ts = engine.open(TEST_FILE, filters=[], fill_country_flag=False)
print(ts.variables())
# stations
ts.data('SOx').stations
# start_times
ts.data('SOx').start_times
# stop_times
ts.data('SOx'.end_times
# latitudes
ts.data('SOx').latitudes
# longitudes
ts.data('SOx').longitudes
# altitudes
ts.data('SOx').altitudes
# values
ts.data('SOx').values
COPYRIGHT
Copyright (C) 2023 Heiko Klein, Daniel Heinesen, Norwegian Meteorological Institute
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, see https://www.gnu.org/licenses/
Metadata
Release files for pyaro 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyaro-0.3.2.tar.gz | 44.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyaro-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.3 kB
Release files / pyaro-0.3.2.tar.gz
| Download URL | pyaro-0.3.2.tar.gz |
|---|---|
| Size | 44.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1833bab30b3a9f44faa677af328e5bfa6d5863ccb344ee6d2f43e2203439ac3
|
|
BLAKE2b-256 checksum How to use checksums |
a58555920f7e2f2e620098f69940037c8a8f1a2e9f4ec9b9eca4cbfaf6acb2a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / pyaro-0.3.2-py3-none-any.whl
| Download URL | pyaro-0.3.2-py3-none-any.whl |
|---|---|
| Size | 43.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b952f279e745267805519400babd91fcdd84103d94cc8aff38731e788d99f8fc
|
|
BLAKE2b-256 checksum How to use checksums |
b976b8d0adea9daf40e7b0ed5b271f302ea0f6f3998010d53efeef7753306bf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency log