Skip to main content

Retrieve data from the Belgian IRM KMI in Python

Project description

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 as a Python module.

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

Quick start example

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
Screenshots of the rain radar animation

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

irm_kmi_api-1.1.1.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

irm_kmi_api-1.1.1-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file irm_kmi_api-1.1.1.tar.gz.

File metadata

  • Download URL: irm_kmi_api-1.1.1.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for irm_kmi_api-1.1.1.tar.gz
Algorithm Hash digest
SHA256 7fcae2290fa499d212ae1dc1a784c89d02224facb516f104f6ebcc23dbc18093
MD5 6e48520380850410b3346c197c333408
BLAKE2b-256 94bea90cae07c473925478620b48fc7ce9e27052bb9010e30c102ed7cbbd879b

See more details on using hashes here.

File details

Details for the file irm_kmi_api-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: irm_kmi_api-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for irm_kmi_api-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 916e5d52e47338f85b6aa6597d14302127cc42f60e8b6c5dfd7409bc44b4edd3
MD5 63767586a57027b42865e8b9a8373f26
BLAKE2b-256 68337234c072cc1d433aec72e30720dc9158a32aa05a0c4d1b5ff64829282014

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page