pyaro py-aerocom reader objects
Project description
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.
Installation
python -m pip install 'pyaro@git+https://github.com/metno/pyaro.git'
This 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/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyaro-0.1.0.tar.gz
.
File metadata
- Download URL: pyaro-0.1.0.tar.gz
- Upload date:
- Size: 37.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf56c51b32eb006a81ee6a86ea461b785a74e87da7bae2ccd12dd7e3827cfdb7 |
|
MD5 | b7560eb438b488f4b857903f6e5d0bf2 |
|
BLAKE2b-256 | 038df2ff57b84902eca6fa2acfe512a7f035887d2a82b32f7b5b6441ff2cbc41 |
Provenance
The following attestation bundles were made for pyaro-0.1.0.tar.gz
:
Publisher:
publish.yml
on metno/pyaro
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pyaro-0.1.0.tar.gz
- Subject digest:
cf56c51b32eb006a81ee6a86ea461b785a74e87da7bae2ccd12dd7e3827cfdb7
- Sigstore transparency entry: 148406023
- Sigstore integration time:
- Predicate type:
File details
Details for the file pyaro-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pyaro-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6de1b72175ee141633bf898323f6a842d3d7544a7941bfeeb36b772e12072f15 |
|
MD5 | 209906190c18775168660bb9891eb6af |
|
BLAKE2b-256 | 0267165fc4cca626f78ba5a02b6be8c0dda998a3a74c0250d16d8d2cbd93a388 |
Provenance
The following attestation bundles were made for pyaro-0.1.0-py3-none-any.whl
:
Publisher:
publish.yml
on metno/pyaro
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pyaro-0.1.0-py3-none-any.whl
- Subject digest:
6de1b72175ee141633bf898323f6a842d3d7544a7941bfeeb36b772e12072f15
- Sigstore transparency entry: 148406024
- Sigstore integration time:
- Predicate type: