imgw-data


Nameimgw-data JSON
Version 0.1.4 PyPI version JSON
download
home_pageNone
SummaryPython API for public IMGW data - atmospheric measurement from Polish weather stations
upload_time2024-06-16 10:16:48
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords api atmospheric science poland weather weather stations
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```

### `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

```python
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)

```

```shell
[
  {'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

```python
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.

```python
from imgw_data.stations import get_active_stations_coordinates


active_stations = get_active_stations_coordinates()
print(active_stations[0])

```

```shell
['12295', 23.162281307080264, 53.10725901708551]
```

## 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/c5/a4/2aa1317944f93a31c260300edd665983c35498fd7afd8b74ee221f0c3a9f/imgw_data-0.1.4.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### `get_current_hydro()`\n\nFunction gets current hydrological observations from IMGW website. Monitored variables (*polish*: *english*):\n\n- 'id_stacji': 'station_id'\n- 'stacja': 'station_name'\n- 'rzeka': 'river',\n- 'wojew\u00f3dztwo': 'voivodeship',\n- 'stan_wody': 'water_level_cm',\n- 'stan_wody_data_pomiaru': 'water_level_measurement_datetime',\n- 'temperatura_wody': 'water_temperature_C',\n- 'temperatura_wody_data_pomiaru': 'water_temperature_measurement_datetime',\n- 'zjawisko_lodowe': 'ice_phenomena_code',\n- 'zjawisko_lodowe_data_pomiaru': 'ice_phenomena_measurement_datetime',\n- 'zjawisko_zarastania': 'vegetation_growth_code',\n- 'zjawisko_zarastania_data_pomiaru': 'vegetation_growth_measurement_datetime',\n\n#### Download as a Python object\n\n```python\nfrom imgw_data import get_current_hydro\n\n\ncurrent_hydro_json = get_current_hydro()  # downloads data as JSON\ncurrent_hydro_pl = get_current_hydro(translate_to_english=False)  # downloads original data with Polish sentences\n\nprint(current_hydro_json)\n\n```\n\n```shell\n[\n  {'station_id': '151140030',\n   'station_name': 'Przewo\u017aniki',\n   'river': 'Skroda',\n   'voivodeship': 'lubuskie',\n   'water_level_cm': '243',\n   'water_level_measurement_datetime': '2024-06-16 09:10:00',\n   'water_temperature_C': None,\n   'water_temperature_measurement_datetime': None,\n   'ice_phenomena_code': '0',\n   'ice_phenomena_measurement_datetime': '2024-01-09 11:00:00',\n   'vegetation_growth_code': '0',\n   'vegetation_growth_measurement_datetime':\n   '2023-09-11 10:00:00'},\n   ...\n]\n```\n\n#### Download and export to file\n\n```python\nfrom imgw_data import get_current_hydro\n\n\ncurrent_weather_json = get_current_hydro(fname='data.json')  # stores data as JSON\n\n```\n\n### `get_active_stations_coordinates()`\n\nReturns list with station id, station longitude, station latitude among the current active stations.\n\n```python\nfrom imgw_data.stations import get_active_stations_coordinates\n\n\nactive_stations = get_active_stations_coordinates()\nprint(active_stations[0])\n\n```\n\n```shell\n['12295', 23.162281307080264, 53.10725901708551]\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.4",
    "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": "69517b1b50185e7d6915ecced4781d5880720b168c7256e6a5796ff8faf1e1ec",
                "md5": "2f90e38baa762db230e29ca718af183e",
                "sha256": "e87b0c85ce8b0336da7d4db818b74bc637b1022d4141f7de8cc7382c69fa0c4e"
            },
            "downloads": -1,
            "filename": "imgw_data-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2f90e38baa762db230e29ca718af183e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 48270,
            "upload_time": "2024-06-16T10:16:46",
            "upload_time_iso_8601": "2024-06-16T10:16:46.307821Z",
            "url": "https://files.pythonhosted.org/packages/69/51/7b1b50185e7d6915ecced4781d5880720b168c7256e6a5796ff8faf1e1ec/imgw_data-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c5a42aa1317944f93a31c260300edd665983c35498fd7afd8b74ee221f0c3a9f",
                "md5": "ce7c3b42fe92aa53d589862b8886a3de",
                "sha256": "e334fa7fe9311b4328937a4e4da8f421d604ac9d8f70585ee8cf30410b5f2130"
            },
            "downloads": -1,
            "filename": "imgw_data-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ce7c3b42fe92aa53d589862b8886a3de",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 51353,
            "upload_time": "2024-06-16T10:16:48",
            "upload_time_iso_8601": "2024-06-16T10:16:48.260570Z",
            "url": "https://files.pythonhosted.org/packages/c5/a4/2aa1317944f93a31c260300edd665983c35498fd7afd8b74ee221f0c3a9f/imgw_data-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-16 10:16:48",
    "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"
}
        
Elapsed time: 0.38881s