Skip to main content

Simple Python interface to the Swedish Meteorological and Hydrological Institute's (SMHI).

Project description

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

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

smhi-open-data-0.0.8.tar.gz (6.9 kB view details)

Uploaded Source

File details

Details for the file smhi-open-data-0.0.8.tar.gz.

File metadata

  • Download URL: smhi-open-data-0.0.8.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for smhi-open-data-0.0.8.tar.gz
Algorithm Hash digest
SHA256 962eabdf1819cd1115c67c541193da3522aeb640dd716dd879150cafdb3edc5b
MD5 c93731b59152f8587e81bff13ab207ca
BLAKE2b-256 a594e67b01319276fe40ca4d020ce3d6c004e85de346ef4626b54d7e4762e481

See more details on using hashes here.

Supported by

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