Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.
/ zadnegoale Public archive

Python wrapper for getting allergen concentration data from Żadnego Ale servers

License

Notifications You must be signed in to change notification settings

bieniu/zadnegoale

Repository files navigation

GitHub Release PyPI PyPI - Downloads Buy me a coffee PayPal_Me

zadnegoale

Python wrapper for getting allergen concentration data from Żadnego Ale

Information

The host api.zadnegoale.pl is down so the service is no longer available.

How to use package

import asyncio
import logging

from aiohttp import ClientError, ClientSession

from zadnegoale import ApiError, InvalidRegionError, ZadnegoAle

REGION = 2

logging.basicConfig(level=logging.DEBUG)


async def main():
    async with ClientSession() as websession:
        try:
            zadnegoale = ZadnegoAle(websession, REGION)
            data = await zadnegoale.async_update(alerts=True)

        except (ApiError, ClientError, InvalidRegionError) as error:
            print(f"Error: {error}")
        else:
            print(f"Region: {zadnegoale.region_name}")
            print(f"Data: {data}")


loop = asyncio.new_event_loop()
loop.run_until_complete(main())
loop.close()