Metadata-Version: 2.4
Name: canairy
Version: 0.3.0rc1
Summary: Client for German public air-quality APIs (UBA, Hamburger Luftmessnetz)
Author-email: Michael Blaß <m.blass@uke.de>
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Framework :: Pydantic :: 2
Classifier: Framework :: Pytest
Classifier: Typing :: Typed
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: hishel>=1.0
Requires-Dist: httpx-limiter>=0.2.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.11.3
Requires-Dist: ratelimit>=2.2.1
Dynamic: license-file

# canairy
Python client for public air-quality APIs: Umweltbundesamt (UBA) and Hamburger Luftmessnetz.

## Example 1
Use data from the Umwelt Bundesamt (UBA)

```python
from datetime import datetime

from canairy.uba import UBAClient
import polars as pl


client = UBAClient()

# plot hourly NO2 values measured at station 'DENW124' between January and February 2019 
rsp = client.get_measures(
    datetime(2019, 1, 1, 0, 0),
    datetime(2019, 2, 1, 0, 0),
    "DENW134",
    5,
    2
)
df = pl.DataFrame(rsp.data)
df.plot.line(x='date_start', y='value').properties(width=600)
```

## Example 2
Use data from the Hamburger Luftmessnetz

```python
Display monthly PM10 data.

import canairy.hh as hh
import polars as pl


client = hh.HHClient()

res = client.get_component_data("pm10_1m")
res = pl.DataFrame(res)

res.plot.line(x='datetime', y='value', color='station').properties(width=800, height=400)
```
