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.1.tar.gz (8.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.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pygeosphere_warnings-0.1.1.tar.gz
Algorithm Hash digest
SHA256 51854e21055991adb21d094c00349397ff1886b81fbf669daf0395879810a8b3
MD5 0743ce16256935cce8f591b3b3b83679
BLAKE2b-256 c585b01baa7a90aff15c9aabcb1767d8f78bc10287d3db78b962c853ed6a8a44

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygeosphere_warnings-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pygeosphere_warnings-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5cb9d5f6dd1d6fcb480d5f4989570ed5280c380620f63be49e880ad42624cdf5
MD5 72aaea13b6002cff658211abca4f1697
BLAKE2b-256 94544c38dac1b534315d42bdfd99fd50895102398123df474f1ceb02ed5fd815

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygeosphere_warnings-0.1.1-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