Skip to main content

Python API for public IMGW data - atmospheric measurement from Polish weather stations

Project description

imgw-data-loader

Python API for IMGW (Polish: Instytut Meteorologii i Gospodarki Wodnej) public data access.

Setup

pip install imgw-data

Usage

get_current_weather()

Function gets current weather from IMGW website. Monitored variables (polish: english):

  • 'id_stacji': 'station_id'
  • 'stacja': 'station_name'
  • 'data_pomiaru': 'observation_date'
  • 'godzina_pomiaru': 'observation_hour'
  • 'temperatura': 'temperature'
  • 'predkosc_wiatru': 'wind_speed'
  • 'kierunek_wiatru': 'wind_direction'
  • 'wilgotnosc_wzgledna': 'relative_humidity'
  • 'suma_opadu': 'precipitation'
  • 'cisnienie': 'pressure'

Download as a Python object

from imgw_data import get_current_weather


current_weather_json = get_current_weather()  # downloads data as JSON
current_weather_csv = get_current_weather(as_csv=True)  # downloads data as string csv
current_weather_xml = get_current_weather(as_xml=True)  # downloads data as string xml
current_weather_html = get_current_weather(as_html=True)  # downloads data as string html

current_weather_pl = get_current_weather(translate_to_english=False)  # downloads original data with Polish sentences

print(current_weather_json)
[
  {'station_id': '12295',
   'station_name': 'Białystok',
   'observation_date': '2024-04-12',
   'observation_hour': '7',
   'temperature': '12.2',
   'wind_speed': '2',
   'wind_direction': '250',
   'relative_humidity': '68.8',
   'precipitation': '0',
   'pressure': '1028.6'}, 
   {...},
]

Download and export to file

from imgw_data import get_current_weather


current_weather_json = get_current_weather(fname='data.json')  # stores data as JSON
current_weather_csv = get_current_weather(fname='data.csv', as_csv=True)  # stores data as string csv
current_weather_xml = get_current_weather(fname='data.xml', as_xml=True)  # stores data as string xml
current_weather_html = get_current_weather(fname='data.html', as_html=True)  # stores data as string html

get_active_stations_coordinates()

Returns list with station id, station longitude, station latitude among the current active stations.

from imgw_data.stations import get_active_stations_coordinates


active_stations = get_active_stations_coordinates()
print(active_stations[0])
['12295', 23.162281307080264, 53.10725901708551]

Dependencies

  • Python >= 3.8
  • requests

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

imgw_data-0.1.3.tar.gz (50.8 kB view details)

Uploaded Source

Built Distribution

imgw_data-0.1.3-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file imgw_data-0.1.3.tar.gz.

File metadata

  • Download URL: imgw_data-0.1.3.tar.gz
  • Upload date:
  • Size: 50.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for imgw_data-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cdca3463d3e5418b6c1ef641473db718b46d372568f2868a62989c952531e419
MD5 38c9db17236adc75085381d0d968561e
BLAKE2b-256 63c07dd5584964c0159f83e47041c91d2ba61407f4382c25cc4dbad3e3f55c0f

See more details on using hashes here.

File details

Details for the file imgw_data-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: imgw_data-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 47.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for imgw_data-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d17ddfad7076acddab29c2b446cc3245699920588ec861531271260ce4c17b69
MD5 7d14c1092257ce1a5274407f79e2e5e5
BLAKE2b-256 5b4ff5d8b2e5650ed280e15f1dd13c0b8f51bc8af6d992803f154f91cc8e957e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page