Python wrapper for getting air quality data from GIOŚ servers.
Project description
gios
Python wrapper for getting air quality data from GIOŚ (Główny Inspektorat Ochrony Środowiska)
How to find station_id
- go to http://powietrze.gios.gov.pl/pjp/current
- find on the map a measurement station located closest to your home
- go to "More info" link
- look at site address, for ex. for this address http://powietrze.gios.gov.pl/pjp/current/station_details/chart/291
station_id
is 291
How to use package
import asyncio
import logging
from aiohttp import ClientError, ClientSession
from gios import ApiError, InvalidSensorsData, Gios, NoStationError
GIOS_STATION_ID = 117
logging.basicConfig(level=logging.DEBUG)
async def main():
try:
async with ClientSession() as websession:
gios = Gios(GIOS_STATION_ID, websession)
data = await gios.async_update()
except (ApiError, NoStationError, InvalidSensorsData, ClientError) as error:
print(f"{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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gios-2.0.0.tar.gz
(9.0 kB
view hashes)
Built Distribution
gios-2.0.0-py3-none-any.whl
(9.0 kB
view hashes)