# imgw-data-loader
Python API for IMGW (Polish: Instytut Meteorologii i Gospodarki Wodnej) public data access.
## Setup
```shell
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
```python
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)
```
```shell
[
{'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
```python
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`
Raw data
{
"_id": null,
"home_page": null,
"name": "imgw-data",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "api, atmospheric science, poland, weather, weather stations",
"author": null,
"author_email": "Szymon Moli\u0144ski <simon@ml-gis-service.com>",
"download_url": "https://files.pythonhosted.org/packages/9f/58/1aa4bd72e62f0ac1938cffd4b895084e720acf85235eb018f7f5d2add30d/imgw_data-0.1.2.post1.tar.gz",
"platform": null,
"description": "# imgw-data-loader\n\nPython API for IMGW (Polish: Instytut Meteorologii i Gospodarki Wodnej) public data access.\n\n## Setup\n\n```shell\npip install imgw-data\n```\n\n## Usage\n\n### `get_current_weather()`\n\nFunction gets current weather from IMGW website. Monitored variables (polish: english):\n\n- 'id_stacji': 'station_id'\n- 'stacja': 'station_name'\n- 'data_pomiaru': 'observation_date'\n- 'godzina_pomiaru': 'observation_hour'\n- 'temperatura': 'temperature'\n- 'predkosc_wiatru': 'wind_speed'\n- 'kierunek_wiatru': 'wind_direction'\n- 'wilgotnosc_wzgledna': 'relative_humidity'\n- 'suma_opadu': 'precipitation'\n- 'cisnienie': 'pressure'\n\n### Download as a Python object\n\n```python\nfrom imgw_data import get_current_weather\n\n\ncurrent_weather_json = get_current_weather() # downloads data as JSON\ncurrent_weather_csv = get_current_weather(as_csv=True) # downloads data as string csv\ncurrent_weather_xml = get_current_weather(as_xml=True) # downloads data as string xml\ncurrent_weather_html = get_current_weather(as_html=True) # downloads data as string html\n\ncurrent_weather_pl = get_current_weather(translate_to_english=False) # downloads original data with Polish sentences\n\nprint(current_weather_json)\n\n```\n\n```shell\n[\n {'station_id': '12295',\n 'station_name': 'Bia\u0142ystok',\n 'observation_date': '2024-04-12',\n 'observation_hour': '7',\n 'temperature': '12.2',\n 'wind_speed': '2',\n 'wind_direction': '250',\n 'relative_humidity': '68.8',\n 'precipitation': '0',\n 'pressure': '1028.6'}, \n {...},\n]\n\n```\n\n### Download and export to file\n\n```python\nfrom imgw_data import get_current_weather\n\n\ncurrent_weather_json = get_current_weather(fname='data.json') # stores data as JSON\ncurrent_weather_csv = get_current_weather(fname='data.csv', as_csv=True) # stores data as string csv\ncurrent_weather_xml = get_current_weather(fname='data.xml', as_xml=True) # stores data as string xml\ncurrent_weather_html = get_current_weather(fname='data.html', as_html=True) # stores data as string html\n\n```\n\n## Dependencies\n\n- Python >= 3.8\n- `requests`",
"bugtrack_url": null,
"license": null,
"summary": "Python API for public IMGW data - atmospheric measurement from Polish weather stations",
"version": "0.1.2.post1",
"project_urls": {
"Documentation": "https://github.com/SimonMolinsky/imgw-data-loader#readme",
"Issues": "https://github.com/SimonMolinsky/imgw-data-loader/issues",
"Source": "https://github.com/SimonMolinsky/imgw-data-loader"
},
"split_keywords": [
"api",
" atmospheric science",
" poland",
" weather",
" weather stations"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "dcedec0a4ce1797ee2720fd54962039e92fead84906a6503d5c2e0d1ef48af55",
"md5": "7bcd87d0478867cb2b48cd2249524669",
"sha256": "9036e9386175173026e590271499686dc58338adbd38a87affc65fd03ceed3c4"
},
"downloads": -1,
"filename": "imgw_data-0.1.2.post1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7bcd87d0478867cb2b48cd2249524669",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 47078,
"upload_time": "2024-04-14T15:23:39",
"upload_time_iso_8601": "2024-04-14T15:23:39.842511Z",
"url": "https://files.pythonhosted.org/packages/dc/ed/ec0a4ce1797ee2720fd54962039e92fead84906a6503d5c2e0d1ef48af55/imgw_data-0.1.2.post1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9f581aa4bd72e62f0ac1938cffd4b895084e720acf85235eb018f7f5d2add30d",
"md5": "a0b7c1d9da15082e577c6c8c17cd8558",
"sha256": "557645ecf7278cb434e45b1cee9b8382843ee6c312b451a6897dda616b1aeeb8"
},
"downloads": -1,
"filename": "imgw_data-0.1.2.post1.tar.gz",
"has_sig": false,
"md5_digest": "a0b7c1d9da15082e577c6c8c17cd8558",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 50464,
"upload_time": "2024-04-14T15:23:38",
"upload_time_iso_8601": "2024-04-14T15:23:38.146058Z",
"url": "https://files.pythonhosted.org/packages/9f/58/1aa4bd72e62f0ac1938cffd4b895084e720acf85235eb018f7f5d2add30d/imgw_data-0.1.2.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-14 15:23:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SimonMolinsky",
"github_project": "imgw-data-loader#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "imgw-data"
}