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
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
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
_, 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.