Skip to main content

SMHI Open Data API

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.

Requirements

  • Python 3.6+

Installation

$ pip install smhi-open-data

Example

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)

Tests

Run tests

$ python -m unittest discover tests

Release files for smhi-open-data 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smhi-open-data 0.0.8
File Size Uploaded
smhi-open-data-0.0.8.tar.gz 6.9 kB Details

Release files / smhi-open-data-0.0.8.tar.gz

Download URL smhi-open-data-0.0.8.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
962eabdf1819cd1115c67c541193da3522aeb640dd716dd879150cafdb3edc5b
BLAKE2b-256 checksum
How to use checksums
a594e67b01319276fe40ca4d020ce3d6c004e85de346ef4626b54d7e4762e481
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.0.8 This release

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page