Skip to content

Python wrapper for the Danish Metrology Institute (DMI) API.

License

Notifications You must be signed in to change notification settings

niklascp/py-dmiapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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())

About

Python wrapper for the Danish Metrology Institute (DMI) API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages