Api reference¶
Main API¶
- async fmi.latest_observations(place: Optional[str] = None, fmisid: Optional[int] = None, starttime: Optional[str] = None, endtime: Optional[str] = None, timestep: int = 10, aiohttp_kwargs: Optional[Any] = None) List[fmi.model.Observation] [source]¶
Fetch most recent weather observations for a specific place. Default is last 12 hours in 10 minute intervals.
- Parameters
place – name for city or town
fmisid – id of a location
starttime – fetch observations after this time. Use ISO 8601 format with second precision
endtime – fetch observations bevore this time. Use ISO 8601 format with second precision
timestep – interval between observations in minutes. Must be divisible by 10
aiohttp_kwargs – keyword arguments for aiohttp request. This is useful for providing timeout, proxy etc. “low level” configuration for the underlying http requests. For possible values see aiohttp.ClientSession.request
- Raises
ValueError – error raised if fmi api returns error, for example no results for given place parameter
- Returns
list of
Observation
objects
- async fmi.forecast(place: str, timestep: int = 60, count: int = 5, aiohttp_kwargs: Optional[Any] = None) List[fmi.model.Forecast] [source]¶
Fetch forecast for single place.
- Parameters
place – search term for place. For example “Arabia, Helsinki”
timestep – interval between forecast points in minutes
count – # of forecast objects. Maximum is 5
- Returns
list of
Forecast
objects
- async fmi.weather_now(place: str, aiohttp_kwargs: Optional[Any] = None) fmi.model.Observation [source]¶
Fetch current weather for a specific place.
- Parameters
place – term for the place, city, or town.
aiohttp_kwargs – see
fmi.Client.latest_observations()
- Raises
ValueError – error raised if fmi api returns error, for example no results for given place parameter
- Returns
Observation
object
- async fmi.sea_levels(fmisid: str, starttime: Optional[str] = None, endtime: Optional[str] = None, timestep: int = 60, aiohttp_kwargs: Optional[Any] = None) List[Tuple[str, Optional[int]]] [source]¶
Fetch 12 hour sea level observations from a mareograph station.
- Parameters
fmisid – FMISID of a mareograph station as listed here
timestep – time interval between results in minutes. Must be divisible by 30
starttime – UTC ISO 8601 time string. Maximum precision is one second
enddtime – UTC ISO 8601 time string
- Returns
list of unix timestamp - sea level -pairs. Units in millimeters
Warning
Different weather stations have considerably different selection of data values. Don’t assume that some specific property would never be None.
Observation¶
- class fmi.Observation[source]¶
Represents single weather condition state.
- clouds¶
clouds 0-8
- coordinates¶
dictionary of lat/lon WGS84 coordinates for the interpreted place
- dewpoint¶
dew point
- humidity¶
relative humidity percentage
- precipitation_1h¶
rain (1h average)
- pressure¶
pressure at sea level
- snow¶
snow in millimeters
- temperature¶
temperature in celsius at two meters from ground surface
- timestamp¶
observation timestamp in unix seconds
- visibility¶
visibility in meters
- property weather_text: Optional[str]¶
finnish description for the observation
- wind_direction¶
wind direction in degrees for 10 minutes
- wind_gust¶
wind gust for 10 minutes
- wind_speed¶
wind speed for 10 minutes
Forecast¶
- class fmi.Forecast[source]¶
Data class for representing forecast API responses
- coordinates¶
dictionary of lat/lon WGS84 coordinates for the interpreted place
- dewpoint: float¶
dew point
- height¶
geopotential height
- high_cloud_cover¶
- humidity¶
relative humidity percentage
- landseamask¶
- low_cloud_cover¶
- max_wind¶
- med_cloud_cover¶
- precipitation_1h¶
rain (1h average)
- precipitation_amount¶
rain amount
- pressure¶
pressure at sea level
- radiation_diffuse_acc¶
- radiation_global_acc¶
- radiation_lwa_acc¶
- radiation_netsurface_lwa_acc¶
- radiation_netsurface_swa_acc¶
- temperature¶
temperature in celsius at two meters from ground surface
- timestamp¶
observation timestamp in unix seconds
- total_cloud_cover¶
- property weather_text: Optional[str]¶
finnish description for the observation
- wind_direction¶
wind direction in degrees for 10 minutes
- wind_gust¶
wind gust for 10 minutes
- wind_speed¶
wind speed for 10 minutes
- wind_ums¶
- wind_vms¶