Metadata-Version: 2.4
Name: irm-kmi-api
Version: 1.1.0
Summary: Retrieve data from the Belgian IRM KMI in Python
Author-email: Jules Dejaeghere <curable.grass491@mailer.me>
License: MIT License
        
        Copyright (c) 2023-2025 Jules Dejaeghere
        
        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.
        
Project-URL: Homepage, https://github.com/jdejaegh/irm-kmi-api
Keywords: weather,weather-api,netherlands,weather-forecast,pollen,belgium,luxembourg,rain-radar
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp<4.0.0,>=3.11.0
Requires-Dist: svgwrite<2.0.0,>=1.4.3
Dynamic: license-file

# Async API to retrieve data from the Belgian IRM KMI in Python

The package exposes the data from the [mobile application of the Belgian IRM KMI](https://www.meteo.be/en/info/faq/products-services/the-rmi-weather-app) as a Python module. 

See more information in the wiki: https://github.com/jdejaegh/irm-kmi-api/wiki

## Quick start example

```python
import aiohttp
import asyncio
from zoneinfo import ZoneInfo
from irm_kmi_api import IrmKmiApiClientHa

async def print_weather():
    session = aiohttp.ClientSession()
    client = IrmKmiApiClientHa(session=session, user_agent="jdejaegh/irm-kmi-api README example")
    await client.refresh_forecasts_coord({'lat': 50.47, 'long': 4.87})
    await session.close()

    weather = client.get_current_weather(tz=ZoneInfo('Europe/Brussels'))
    city = client.get_city()

    print(f"{weather['temperature']}°C with wind of {weather['wind_speed']} km/h in {city}")


if __name__ == '__main__':
    asyncio.run(print_weather())
```


## Features

The package provides the following:  
1. Current weather
2. Hourly and daily forecast
3. Rain radar forecast and animation
4. Warning data (for extreme weather condition such as storm, thunder, floods)
5. Pollen data

<details>
<summary>Screenshots of the rain radar animation</summary>
<img src="https://github.com/jdejaegh/irm-kmi-api/raw/main/img/camera_light.png"/>  <br>
<img src="https://github.com/jdejaegh/irm-kmi-api/raw/main/img/camera_dark.png"/>  <br>
<img src="https://github.com/jdejaegh/irm-kmi-api/raw/main/img/camera_sat.png"/>  
</details>

## Limitations

The package does not provide the 14-days forcast as in the application.  

This package will not implement any feature that is not available via the API (e.g., humidity and dew point data is not
provided by the API and thus is not available in this package).


## Usage considerations

The API is not publicly documented and has been reversed engineered: it can change at any time without notice and break this package.  

Be mindful when using the API: put a meaningful User-Agent string when creating an `IrmKmiApiClient` and apply rate-limiting for your queries.


## Contributions

Contributions are welcome.  Please discuss major changes in an issue before submitting a pull request.



## Disclaimer

This is a personal project and isn't in any way affiliated with, sponsored or endorsed by [The Royal Meteorological 
Institute of Belgium](https://www.meteo.be).

All product names, trademarks and registered trademarks in (the images in) this repository, are property of their 
respective owners. All images in this repository are used by the project for identification purposes only.
