Skip to main content

Python wrapper for getting air quality data from GIOŚ servers.

Project description

CI codecov GitHub Release PyPI PyPI - Downloads Buy me a coffee PayPal_Me Revolut.Me

gios

Python wrapper for getting air quality data from GIOŚ (Główny Inspektorat Ochrony Środowiska)

How to find station_id

How to use package

"""Example for GIOS."""
import asyncio
import logging

from aiohttp import ClientError, ClientSession

from gios import ApiError, Gios, InvalidSensorsData, NoStationError

GIOS_STATION_ID = 568

logging.basicConfig(level=logging.DEBUG)


async def main() -> None:
    """Run main function."""
    async with ClientSession() as websession:
        gios = Gios(GIOS_STATION_ID, websession)
        try:
            data = await gios.async_update()
        except (ApiError, NoStationError, InvalidSensorsData, ClientError) as error:
            print(error)
            return

    latitude = gios.latitude
    longitude = gios.longitude
    station_name = gios.station_name
    print(f"Longitude: {longitude}")
    print(f"Latitude: {latitude}")
    print(f"Station name: {station_name}")
    print(data)


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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

How to create a dev environment

git clone https://github.com/bieniu/gios.git
cd gios
./scripts/setup-local-env.sh

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

gios-7.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

gios-7.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file gios-7.1.0.tar.gz.

File metadata

  • Download URL: gios-7.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gios-7.1.0.tar.gz
Algorithm Hash digest
SHA256 f90dd94e1466162c3d59d12ecf44e2a843b4eef589dc6357ca33e6f0041e239b
MD5 6b4c7302e7c02698256d2cc2dbe99148
BLAKE2b-256 608e90a45d0867f82a0709ae345f413e4bb1be88f4c80411a263bb4cf1c981c8

See more details on using hashes here.

File details

Details for the file gios-7.1.0-py3-none-any.whl.

File metadata

  • Download URL: gios-7.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gios-7.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e904af5b940621304765a6a9c178595fa2267dc9339a0ed5cf872adccd19132
MD5 71b2f503ac5d42fb3d0b4314be3c8fef
BLAKE2b-256 f169955627654d1c4d288367bab6ad0df2131eca65b290581b964937a77c831d

See more details on using hashes here.

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