Async Python client for the Atmospore pollen forecast API.
Project description
atmospore — async Python client
Async client for the Atmospore pollen forecast API. Species-level pollen forecasts for any point on Earth.
pip install atmospore
Usage
Get a free API key at atmospore.com/account (100 calls/day, no credit card required).
import asyncio
from atmospore import AtmosporeClient
async def main():
async with AtmosporeClient(api_key="ak_...") as client:
# Point forecast
days = await client.pollen(lat=59.91, lon=10.75, forecast_days=7)
for day in days:
print(day.date, day.overall_risk)
# Top contributing species today
top = await client.pollen_top(lat=59.91, lon=10.75, limit=5)
for s in top:
print(s.species, s.max_value, s.units, s.risk_level)
# Area aggregate (avg/min/max over a radius)
area = await client.pollen_area(
lat=59.91, lon=10.75, radius_km=25, forecast_days=7,
species=["tree_tot", "grass_tot", "weed_tot"],
)
# Species metadata (no auth required)
species = await client.species()
asyncio.run(main())
API surface
| Method | Endpoint | Returns |
|---|---|---|
client.pollen(lat, lon, dt?, forecast_days=1) |
/v1/pollen |
list[DailyPollen] |
client.pollen_top(lat, lon, dt?, forecast_days=1, limit?) |
/v1/pollen-top |
list[TopSpecies] |
client.pollen_area(lat, lon, radius_km=25, dt?, forecast_days=1, species?) |
/v1/pollen-area |
list[DailyPollen] |
client.species() |
/v1/species |
list[SpeciesMetadata] (no auth) |
Errors
from atmospore import (
AuthenticationError, # 401/403 — bad / missing / revoked key
RateLimitError, # 429 — daily quota exceeded
APIError, # other 4xx / 5xx with status + body
AtmosporeError, # base class
)
RateLimitError carries .limit, .used, .resets_at for graceful backoff.
Behaviour
- Async-first via
aiohttp. Use asasync with AtmosporeClient(...)or callawait client.close(). - Retries on 5xx with exponential backoff (3 retries by default).
- Risk levels normalised to Title Case (
'Low','Moderate','High','Very High') regardless of how the API serialises them. - Pydantic models for typed access to response data.
Development
git clone https://github.com/atmospore/atmospore-python
cd atmospore-python
pip install -e ".[test]"
pytest
Related
- atmospore-mcp — MCP server for Claude and other AI assistants, built on this client.
- atmospore.com — the hosted forecast and developer dashboard.
License
MIT.
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 atmospore-0.1.0.tar.gz.
File metadata
- Download URL: atmospore-0.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
197f3c8f7381ebee6784bf5021c93d576f97bf64d537d5a30832e20e542777c2
|
|
| MD5 |
a1172e854a0e60e71a81fab94453bbb2
|
|
| BLAKE2b-256 |
3819757b6b68f1053ba0b7cfecadfa1471e327b97d5907fb874f47a21d673231
|
Provenance
The following attestation bundles were made for atmospore-0.1.0.tar.gz:
Publisher:
release.yml on atmospore/atmospore-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atmospore-0.1.0.tar.gz -
Subject digest:
197f3c8f7381ebee6784bf5021c93d576f97bf64d537d5a30832e20e542777c2 - Sigstore transparency entry: 1615079314
- Sigstore integration time:
-
Permalink:
atmospore/atmospore-python@9a35039f1e201a782b73b7b72300ec9cfa201091 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/atmospore
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9a35039f1e201a782b73b7b72300ec9cfa201091 -
Trigger Event:
push
-
Statement type:
File details
Details for the file atmospore-0.1.0-py3-none-any.whl.
File metadata
- Download URL: atmospore-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8602840bc0d81a58e772ed7cf72329eb0b2ec1c80ddc1c14f162661c14f2c69d
|
|
| MD5 |
0341aad045320c40399aebf35ca26255
|
|
| BLAKE2b-256 |
e331cd4fbb257446d930f9d00fb82b29702b5fe9b019b4a7a81a05f8010c6927
|
Provenance
The following attestation bundles were made for atmospore-0.1.0-py3-none-any.whl:
Publisher:
release.yml on atmospore/atmospore-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atmospore-0.1.0-py3-none-any.whl -
Subject digest:
8602840bc0d81a58e772ed7cf72329eb0b2ec1c80ddc1c14f162661c14f2c69d - Sigstore transparency entry: 1615079317
- Sigstore integration time:
-
Permalink:
atmospore/atmospore-python@9a35039f1e201a782b73b7b72300ec9cfa201091 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/atmospore
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9a35039f1e201a782b73b7b72300ec9cfa201091 -
Trigger Event:
push
-
Statement type: