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(station_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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: dmiapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.1

File hashes

Hashes for dmiapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df03cc8784cd1266f4965c643e5b321ed46b988ac4a425f4ad8550db452c78f5
MD5 8ffdc34e2ddd2caccae96a9175f5125e
BLAKE2b-256 d8e75f0b65602a99d5aed90281512710b4e117f5c50524635d63f307a664ee28

See more details on using hashes here.

Supported by

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