Library for fetching weather information from Finnish Meteorological Institute (FMI)
Project description
Finnish Meteorological Institute Weather
Library for fetching weather information from Finnish Meteorological Institute (FMI).
Originally build for personal use because I wanted to create FMI integration for Home Assistant.
BETA WARNING! This is still under heavy development. The public API is not frozen yet so DO NOT consider it to be stable. Any version can have breaking changes.
How to use
Working example can be found in example.py.
Install
$ pip install fmi-weather-client
Get weather and forecasts
import fmi_weather_client
weather1 = fmi_weather_client.weather_by_coordinates(60.170998, 24.941325)
weather2 = fmi_weather_client.weather_by_place_name("Rastila, Helsinki")
forecast1 = fmi_weather_client.forecast_by_place_name("Jäppilä, Pieksämäki")
forecast2 = fmi_weather_client.forecast_by_coordinates(67.6894, 28.62406, timestep_hours=12)
There are also asynchronous versions available:
weather1 = await fmi_weather_client.async_weather_by_coordinates(60.170998, 24.941325)
weather2 = await fmi_weather_client.async_weather_by_place_name("Rastila, Helsinki")
forecast1 = await fmi_weather_client.async_forecast_by_place_name("Jäppilä, Pieksämäki")
forecast2 = await fmi_weather_client.async_forecast_by_coordinates(67.6894, 28.62406, timestep_hours=12)
If data is not available, the following exception is thrown:
fmi_weather_client.errors.NoWeatherDataError
Weather data
FMI provides the following commonly used information:
- Temperature (°C)
- Pressure (hPa)
- Humidity (%)
- Wind direction (°)
- Wind speed (m/s)
- Wind gust (m/s)
- Dew point (°)
- Cloud coverage (%)
- Precipitation intensity (mm/h)
- Symbol Documentation in Finnish
There are also other information available. Check models.py and FMI documentation for more info.
Development
Setup
Create and activate a virtual environment
$ python -m venv venv
$ source venv/bin/activate
Install required packages
$ make setup-dev-env
Deactivate virtual environment when you are done
$ deactivate
Run tests
This will run unit tests and code quality checks
$ make test
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fmi-weather-client-0.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa89c4049f7ca9335f968356b083cc668b799b5c8a9da65731bfc0b6fbf90f77 |
|
MD5 | 8f6b6c836f2a3acdece877e2cc832516 |
|
BLAKE2b-256 | 12a67beb7b3404a7af49cfa53fcd6cec124df94e7f67fe847cdbb9afda2f471a |
Hashes for fmi_weather_client-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6acf1ac2163a78e968236da3ef413bfd92ae31f00bc12f0c69cd67df729856fe |
|
MD5 | a3cdd4a3d6ff913ba347488b8acd7b22 |
|
BLAKE2b-256 | 2cf85a37e96fe3a24b99cc8004598051aee16e59c8f5cd79aae530bd62ccb483 |