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.

Files for dmiapi, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size dmiapi-0.1.2-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size dmiapi-0.1.2.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page