Simple Python interface to the Swedish Meteorological and Hydrological Institute's (SMHI) Open Data API.
Weather data from Sweden are publicly available through SMHI's Open Data API. Fetch raw weather observations from all available weather stations in Sweden. Parameters available include temperature, windspeed, humidity, pressure, precipitation_, and many more.
- Python 3.6+
$ pip install smhi-open-data
from smhi_open_data import SMHIOpenDataClient, Parameter
# Get 10 stations
client = SMHIOpenDataClient()
# Get all stations
stations = client.get_stations()
# Get closest station
closest_station = client.get_closest_station(
latitude=55.707722,
longitude=12.562119)
# Get available parameters
parameters = client.list_parameters()
# Get available parameters at station
parameters_station = client.get_station_parameters(station_id=173010)
# Get temperature observations from available stations from past hour
observations = client.get_latest_observations(
parameter=Parameter.TemperaturePast1h)
Run tests
$ python -m unittest discover tests