Metadata-Version: 2.5
Name: imgw-meteo
Version: 0.1.0
Summary: Download, standardize and query IMGW (Poland) meteorological measurement data, with PyTorch dataloaders.
Project-URL: Homepage, https://github.com/Kabanosk/imgw-meteo
Project-URL: Source, https://github.com/Kabanosk/imgw-meteo
Project-URL: Issues, https://github.com/Kabanosk/imgw-meteo/issues
Project-URL: Documentation, https://imgw-meteo.readthedocs.io
Author: Wojciech Fiołka
License: MIT License
        
        Copyright (c) 2026 Wojciech Fiołka
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: dataset,imgw,meteorology,poland,pytorch,weather
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Python: >=3.12
Requires-Dist: httpx>=0.27
Requires-Dist: loguru>=0.7
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: pydantic>=2.0
Provides-Extra: all
Requires-Dist: rich>=13.0; extra == 'all'
Requires-Dist: torch>=2.0; extra == 'all'
Requires-Dist: typer>=0.12; extra == 'all'
Provides-Extra: cli
Requires-Dist: rich>=13.0; extra == 'cli'
Requires-Dist: typer>=0.12; extra == 'cli'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest-httpx>=0.30; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: furo>=2024.1; extra == 'docs'
Requires-Dist: myst-parser>=2.0; extra == 'docs'
Requires-Dist: sphinx-copybutton>=0.5; extra == 'docs'
Requires-Dist: sphinx>=7.0; extra == 'docs'
Provides-Extra: tf
Requires-Dist: tensorflow>=2.13; extra == 'tf'
Provides-Extra: torch
Requires-Dist: torch>=2.0; extra == 'torch'
Description-Content-Type: text/markdown

# imgw-meteo

[![CI](https://github.com/Kabanosk/imgw-meteo/actions/workflows/ci.yml/badge.svg)](https://github.com/Kabanosk/imgw-meteo/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/imgw-meteo.svg)](https://pypi.org/project/imgw-meteo/)
[![Python](https://img.shields.io/pypi/pyversions/imgw-meteo.svg)](https://pypi.org/project/imgw-meteo/)
[![Docs](https://readthedocs.org/projects/imgw-meteo/badge/?version=latest)](https://imgw-meteo.readthedocs.io)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Download, **standardize** and query IMGW (Poland) meteorological measurement
data — with a clean Python API, a `imgw-meteo` CLI, and PyTorch dataloaders for
machine learning.

Data source: <https://dane.imgw.pl/data/dane_pomiarowo_obserwacyjne/dane_meteorologiczne/>

> Scope: this package covers the **meteorological** (`dane_meteorologiczne`)
> dataset only, not hydrological data.

## Why standardize?

The raw IMGW files drift year to year, which breaks naive pipelines:

- source files are **Windows-1250** encoded (decoded once internally; everything
  you touch is UTF-8);
- decimals appear as `-.4` / `.0` in some years and `-0.4` / `0.0` in others;
- empty cells are sometimes quoted (`""`), sometimes not;
- status codes `8` (no measurement) and `9` (no phenomenon) leak in as real
  values unless converted to missing;
- the same logical dataset is split across different file layouts by era;
- station names are space-padded to fixed width in some station types.

`imgw-meteo` resolves all of this into a tidy table with **stable, declared
dtypes** (from a frozen canonical schema, never inferred) and proper missing
values — then hands it to you as a pandas DataFrame or ready-to-train PyTorch
dataloaders.

## Install

```bash
pip install imgw-meteo          # API only
pip install imgw-meteo[cli]     # + the `imgw-meteo` command
pip install imgw-meteo[torch]   # + PyTorch dataloaders
pip install imgw-meteo[all]     # everything
```

## Quick start

```python
from imgw_meteo import IMGWClient

client = IMGWClient()

# describe a selection (nothing downloads until you ask for data)
df = (
    client.select(frequency="daily", station_type="synop", years=2025, months=6)
    .get_dataframe()
)
print(df[["datetime", "POST", "TMAX", "TMIN", "SMDB"]].head())

# find stations (diacritic-insensitive)
for s in client.stations().search("kraków"):
    print(s)
```

### PyTorch dataloaders

```python
train, val, test = (
    client.select(frequency="daily", station_type="synop", years=range(2015, 2026))
    .get_dataloaders(
        features=["TMAX", "TMIN", "STD"],
        targets=["TMAX"],
        input_window=30, horizon=1, batch_size=64,
    )
)
for x, y in train:        # x: (64, 30, 3)   y: (64, 1, 1)
    ...
    break
```

Chronological split (no leakage), train-only normalization, and per-station
windowing are the defaults. See the docs for a full LSTM training example.

## CLI

```bash
imgw-meteo stations --name "Kraków"
imgw-meteo years --freq daily --type synop
imgw-meteo fetch --freq daily --type synop --year 2025 --month 6 --output out.parquet
```

## Data coverage

| | synop | klimat | opad |
|---|---|---|---|
| daily | ✅ | ✅ | ✅ |
| monthly | ✅ | ✅ | ✅ |
| term | ✅ | ✅ | — (not published) |

## Documentation

Full guide, configuration reference, and examples:
<https://imgw-meteo.readthedocs.io>

## License

MIT
