Skip to content

A python library for interacting with the MET Norway Weather API

License

Notifications You must be signed in to change notification settings

andersle/normetapi

Repository files navigation

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.

About

A python library for interacting with the MET Norway Weather API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published