Skip to main content

Asynchronous Python client for the GeoSphere Austria Warn API

Project description

pygeosphere-warnings

PyPI CI License: MIT

Asynchronous Python client for the GeoSphere Austria Warn API, which provides the official GeoSphere Austria weather warnings for all municipalities in Austria.

Usage

import asyncio

import aiohttp

from pygeosphere_warnings import GeoSphereWarningsClient


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        client = GeoSphereWarningsClient(session)

        # Cheap HEAD precheck: timestamp of the latest warning update
        last_modified = await client.get_last_modified()
        print(f"Warnings last updated: {last_modified}")

        # Warnings for the municipality at the given coordinates
        warnings = await client.get_warnings_for_coords(48.2486, 16.3564, "en")
        print(f"Municipality: {warnings.municipality.name}")
        for warning in warnings.warnings:
            print(f"- {warning.warning_type.name} ({warning.level.name}): {warning.text}")

        # Automated thunderstorm warnings (municipality id -> intensity)
        thunderstorms = await client.get_thunderstorms()
        print(thunderstorms.get(warnings.municipality.municipality_id))


asyncio.run(main())

License

MIT. Warning data: © GeoSphere Austria, CC BY 4.0.

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

pygeosphere_warnings-0.1.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

pygeosphere_warnings-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pygeosphere_warnings-0.1.0.tar.gz.

File metadata

  • Download URL: pygeosphere_warnings-0.1.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygeosphere_warnings-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12fc9593ec81c315d239c2f4c4715c89636c27cf49e167343c81ca39aa49d149
MD5 17d3a467392044502a817218bcb18d6f
BLAKE2b-256 ddfb6720e0462d2888bdedb97ef3b3ec934f21c8b645da64c11fdfee07e39432

See more details on using hashes here.

Provenance

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

Publisher: release.yml on tklecka/pygeosphere-warnings

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

File details

Details for the file pygeosphere_warnings-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pygeosphere_warnings-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 430a398fd2ed03787099f64df7f61452355d3ae9940523a79affafd5e5dbc190
MD5 7cf0f2818e046919a11277af3c8c74d0
BLAKE2b-256 b0cd27fac86c166f3e3617fd0b8dc6da8bd05ffaa5ceed5d421f62f11bdaabd2

See more details on using hashes here.

Provenance

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

Publisher: release.yml on tklecka/pygeosphere-warnings

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