Skip to main content

A small library for interacting with the MET Norway Weather API.

Project description

normetapi

A small Python library for interacting with the MET Norway Weather API.

Installation

pip install normetapi

Examples

Getting a forecast for a specified location:

from normetapi import location_forecast

# Get forecast for Trondheim:
forecast = location_forecast(63.4107, 10.4538)
print(forecast)

The forecast will be returned as a dictionary. See the description of locationforecast and the data model in the MET Norway Weather API description.

Getting the immediate forecast for a specified location:

from normetapi import nowcast

# Get nowcast for Trondheim:
forecast = nowcast(63.4107, 10.4538, altitude=123)
print(forecast)

The forecast will be returned as a dictionary. See the description of nowcast and the data model in the MET Norway Weather API description.

Getting weather icons:

from normetapi import weathericon

# Get icons:
_, legend = weathericon(output_file='icons.tgz')
print(legend)

This will download weather icons as a gzipped tar archive and return legends as a dictionary. See the description of weathericon in the MET Norway Weather API description.

Terms of service

Please read the terms of service. In particular, to quote the terms of service:

All requests must (if possible) include an identifying User Agent-string (UA) in the request with the application/domain name, optionally version number.

Please modify the USER_AGENT variable in api.py to fit your intended use.

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

normetapi-0.1.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

normetapi-0.1.0-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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