Skip to main content

imgw-data-loader

Python API for IMGW (Polish: Instytut Meteorologii i Gospodarki Wodnej) public data access with current weather and hydro observations.

Setup

pip install imgw-data

Data

  • all time related variables are in UTC
  • coordinates are in EPSG:4326
  • temperature unit is Celsius
  • elevation is in meters (above the sea level)

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'
  • 'mnpm': 'elevation'

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

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

  • 'id_stacji': 'station_id'
  • 'stacja': 'station_name'
  • 'rzeka': 'river',
  • 'województwo': 'voivodeship',
  • 'stan_wody': 'water_level_cm',
  • 'stan_wody_data_pomiaru': 'water_level_measurement_datetime',
  • 'temperatura_wody': 'water_temperature_C',
  • 'temperatura_wody_data_pomiaru': 'water_temperature_measurement_datetime',
  • 'zjawisko_lodowe': 'ice_phenomena_code',
  • 'zjawisko_lodowe_data_pomiaru': 'ice_phenomena_measurement_datetime',
  • 'zjawisko_zarastania': 'vegetation_growth_code',
  • 'zjawisko_zarastania_data_pomiaru': 'vegetation_growth_measurement_datetime',

Download as a Python object

from imgw_data import get_current_hydro


current_hydro_json = get_current_hydro()  # downloads data as JSON
current_hydro_pl = get_current_hydro(translate_to_english=False)  # downloads original data with Polish sentences

print(current_hydro_json)
[
  {'station_id': '151140030',
   'station_name': 'Przewoźniki',
   'river': 'Skroda',
   'voivodeship': 'lubuskie',
   'water_level_cm': '243',
   'water_level_measurement_datetime': '2024-06-16 09:10:00',
   'water_temperature_C': None,
   'water_temperature_measurement_datetime': None,
   'ice_phenomena_code': '0',
   'ice_phenomena_measurement_datetime': '2024-01-09 11:00:00',
   'vegetation_growth_code': '0',
   'vegetation_growth_measurement_datetime':
   '2023-09-11 10:00:00'},
   ...
]

Download and export to file

from imgw_data import get_current_hydro


current_weather_json = get_current_hydro(fname='data.json')  # stores data as JSON

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.9
  • requests

Metadata

Release files for imgw-data 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imgw-data 0.1.6
File Size Uploaded
imgw_data-0.1.6.tar.gz 52.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imgw-data 0.1.6
File Interpreter ABI Platform
imgw_data-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 101.5 kB

Release files / imgw_data-0.1.6.tar.gz

Download URL imgw_data-0.1.6.tar.gz
Size 52.4 kB
Tags Source
SHA-256 checksum
How to use checksums
101b2b3ed8db73957a87e7102862d2635e2835be3a7160f0f959d2ed036d353d
BLAKE2b-256 checksum
How to use checksums
39d278e083fd5137451c082008c02176c59c5516af0df7bd9cead2361875cfc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / imgw_data-0.1.6-py3-none-any.whl

Download URL imgw_data-0.1.6-py3-none-any.whl
Size 49.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17e3ea0abfe39a75dcdddce13678eb26761064f94969eadfda9c95fda987298c
BLAKE2b-256 checksum
How to use checksums
a738130f0e9ebbdcfafb920789bf1409de2f0bb19348a686e266363406cdbed4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page