Skip to main content

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 as async with AtmosporeClient(...) or call await 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atmospore-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atmospore-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

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

Hashes for atmospore-0.1.0.tar.gz
Algorithm Hash digest
SHA256 197f3c8f7381ebee6784bf5021c93d576f97bf64d537d5a30832e20e542777c2
MD5 a1172e854a0e60e71a81fab94453bbb2
BLAKE2b-256 3819757b6b68f1053ba0b7cfecadfa1471e327b97d5907fb874f47a21d673231

See more details on using hashes here.

Provenance

The following attestation bundles were made for atmospore-0.1.0.tar.gz:

Publisher: release.yml on atmospore/atmospore-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for atmospore-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8602840bc0d81a58e772ed7cf72329eb0b2ec1c80ddc1c14f162661c14f2c69d
MD5 0341aad045320c40399aebf35ca26255
BLAKE2b-256 e331cd4fbb257446d930f9d00fb82b29702b5fe9b019b4a7a81a05f8010c6927

See more details on using hashes here.

Provenance

The following attestation bundles were made for atmospore-0.1.0-py3-none-any.whl:

Publisher: release.yml on atmospore/atmospore-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page