Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dmiapi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dmiapi

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

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
1

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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc