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
Dependencies
- Python >= 3.8
requests
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
imgw_data-0.1.2.post1.tar.gz
(50.5 kB
view details)
Built Distribution
File details
Details for the file imgw_data-0.1.2.post1.tar.gz
.
File metadata
- Download URL: imgw_data-0.1.2.post1.tar.gz
- Upload date:
- Size: 50.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 557645ecf7278cb434e45b1cee9b8382843ee6c312b451a6897dda616b1aeeb8 |
|
MD5 | a0b7c1d9da15082e577c6c8c17cd8558 |
|
BLAKE2b-256 | 9f581aa4bd72e62f0ac1938cffd4b895084e720acf85235eb018f7f5d2add30d |
File details
Details for the file imgw_data-0.1.2.post1-py3-none-any.whl
.
File metadata
- Download URL: imgw_data-0.1.2.post1-py3-none-any.whl
- Upload date:
- Size: 47.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9036e9386175173026e590271499686dc58338adbd38a87affc65fd03ceed3c4 |
|
MD5 | 7bcd87d0478867cb2b48cd2249524669 |
|
BLAKE2b-256 | dcedec0a4ce1797ee2720fd54962039e92fead84906a6503d5c2e0d1ef48af55 |