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

Latest commit

 

History

History
55 lines (41 loc) · 1.88 KB

README.md

File metadata and controls

55 lines (41 loc) · 1.88 KB

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()