Skip to main content

Wrapper for access weather observations and forecasts from the Danish Metrology Institute (DMI) API

Project description

Installation

pip install dmiapi

Data available

  • observations
  • forecasts

Usage

The wrapper supports both synchronous and asynchronous methods.

Synchronous example

import pandas as pd
import dmiapi

client = dmiapi.DmiApiClient()

obs_response = client.observations(station_id = 2619856)
obs = pd.DataFrame(obs_response['observations'])
print('Mean temperature (2 meters above ground):', obs['temperature2m'].mean())

Asynchronous example

import pandas as pd
import dmiapi

async def max_forecast_temp():
    client = dmiapi.DmiApiClient()
    forecasts_response = await client.async_forecasts(location_id = 2619856)
    forecasts = pd.DataFrame(forecasts_response['forecasts'])
    print('Forcasted max. temperature:', forecasts['temp'].max())

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

dmiapi-0.1.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

dmiapi-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file dmiapi-0.1.2.tar.gz.

File metadata

  • Download URL: dmiapi-0.1.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.2

File hashes

Hashes for dmiapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8297a9a1a8f4789bab0f9b13344ca1ae8dfb21ca6455f0188c03bff5d72849a7
MD5 9e653eb540ee1ff98160debb1713888b
BLAKE2b-256 7244c7d68dacb3b20336a8f5a5e7279ce8dc2bc8239a75aac764b09acaf592bf

See more details on using hashes here.

File details

Details for the file dmiapi-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dmiapi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.2

File hashes

Hashes for dmiapi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9ebb7b7b6db24775e3990d890400597bc5e4b5635325074c2df0dae56f254dd
MD5 ff89d2acde0309fbb299ea2c3aa841f4
BLAKE2b-256 db848a4067c1dbd38d537d9baa0512daf307ddcbbd91d53b1866b1dfb1c4d71a

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