Python interface to RSIG Web API
Project description
pyrsig
pyrsig is a Python interface to the RSIG Web API. RSIG connects you to
petabytes of air quality data from EPA, NASA, NOAA, and many other partners.
pyrsig connects RSIG to xarray, pandas, and all your favorite python libraries.
Install
There are two easy ways to isntall pyrsig easily.
From pypi.org (most stable):
pip install pyrsig
From github (latest):
pip install git+https://github.com/barronh/pyrsig.git
User Guide
Many examples, tutorials, and guides are available at https://barronh.github.io/pyrsig. Only a few very basic examples are shown below.
Example
Get DataFrame for AQS ozone
import pyrsig
rsigapi = pyrsig.RsigApi(bdate='2022-03-01')
print([k for k in rsigapi.keys() if 'ozone' in k])
# ['airnow.ozone', 'airnow2.ozone', 'aqs.ozone', 'aqs.ozone_8hour_average', 'aqs.ozone_daily_8hour_maximum', 'pandora.ozone']
df = rsigapi.to_dataframe('aqs.ozone')
print(df.shape, *df.columns)
# (26760, 6) Timestamp(UTC) LONGITUDE(deg) LATITUDE(deg) STATION(-) ozone(ppb) SITE_NAME
Get DataFrame for PurpleAir PM25
import pyrsig
rsigapi = pyrsig.RsigApi(bdate='2022-03-01')
rsigapi.purpleair_kw['api_key'] = '<put your api key here>'
df = rsigapi.to_dataframe('purpleair.pm25_corrected')
Get DataFrame for TropOMI NO2
import pyrsig
rsigapi = pyrsig.RsigApi(bdate='2022-03-01')
df = rsigapi.to_dataframe('tropomi.offl.no2.nitrogendioxide_tropospheric_column')
print(df.shape, *df.columns)
# (303444, 4) Timestamp(UTC) LONGITUDE(deg) LATITUDE(deg) nitrogendioxide_tropospheric_column(molecules/cm2)
Get IOAPI formatted NetCDF TropOMI NO2
import pyrsig
rsigapi = pyrsig.RsigApi(bdate='2022-03-01')
ds = rsigapi.to_ioapi('tropomi.offl.no2.nitrogendioxide_tropospheric_column')
print(ds.data_vars)
# Data variables:
# TFLAG (TSTEP, VAR, DATE-TIME) int32 ...
# LONGITUDE (TSTEP, LAY, ROW, COL) float32 ...
# LATITUDE (TSTEP, LAY, ROW, COL) float32 ...
# COUNT (TSTEP, LAY, ROW, COL) int32 ...
# NO2 (TSTEP, LAY, ROW, COL) float32 ...
Get List of Possible
import pyrsig
rsigapi = pyrsig.RsigApi()
keys = rsigapi.keys()
print(len(keys), keys)
# 80 ('airnow.pm25', ... 'aqs.ozone', ... 'cmaq.equates.conus.aconc.O3', ... 'hms.smoke',
# 'metar.wind', ... 'pandora.ozone', 'purpleair.pm25_corrected', ...
# 'tropomi.offl.no2.nitrogendioxide_tropospheric_column', ...
# 'viirsnoaa.jrraod.AOD550', ...)
keys = rsigapi.keys(offline=False) # slow and likely to many options
print(len(keys))
# 3875
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrsig-0.12.0.tar.gz.
File metadata
- Download URL: pyrsig-0.12.0.tar.gz
- Upload date:
- Size: 192.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e50550a29e44542e7210fa17243cb149af22df0f1da8ee745dc0676c14c05d33
|
|
| MD5 |
90b53dee856406d3e930eecc4c8fc0c5
|
|
| BLAKE2b-256 |
7292b620ea90e691c9c75f6ddc2b4b35314493c31287d3a848ead5033c362162
|
Provenance
The following attestation bundles were made for pyrsig-0.12.0.tar.gz:
Publisher:
python-publish.yml on barronh/pyrsig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrsig-0.12.0.tar.gz -
Subject digest:
e50550a29e44542e7210fa17243cb149af22df0f1da8ee745dc0676c14c05d33 - Sigstore transparency entry: 985649643
- Sigstore integration time:
-
Permalink:
barronh/pyrsig@44b4ece29da5d71d09c175d9be0240ed55d98cde -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/barronh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@44b4ece29da5d71d09c175d9be0240ed55d98cde -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyrsig-0.12.0-py3-none-any.whl.
File metadata
- Download URL: pyrsig-0.12.0-py3-none-any.whl
- Upload date:
- Size: 197.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b4320432bbf0530b2f59de9f91afab5b03630c497b3a60501e1f70972fc6eca
|
|
| MD5 |
2806407691658d2e3b204ab930cad478
|
|
| BLAKE2b-256 |
9186c568028fea021984bbf2f29addd19b03576d0d6fbfdbcc36c8436607c4c5
|
Provenance
The following attestation bundles were made for pyrsig-0.12.0-py3-none-any.whl:
Publisher:
python-publish.yml on barronh/pyrsig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrsig-0.12.0-py3-none-any.whl -
Subject digest:
9b4320432bbf0530b2f59de9f91afab5b03630c497b3a60501e1f70972fc6eca - Sigstore transparency entry: 985649694
- Sigstore integration time:
-
Permalink:
barronh/pyrsig@44b4ece29da5d71d09c175d9be0240ed55d98cde -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/barronh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@44b4ece29da5d71d09c175d9be0240ed55d98cde -
Trigger Event:
release
-
Statement type: