A simple module to parse the XML format and extract the temperature
and the precipitation of the Norwegian YR weather station API.
pip install tinymesh-yr
The method get_forecast takes in 1 argument Town and 1 optional parameter
Country which defaults to 'Norway'.
Returns the most recent temperature and precipitation forecast.
from yr import Weather
yr = Weather()
t, p = yr.get_forecast('Oslo') # second parameter defaults to NorwayYou should read and understand the YR.no terms of use which is only available in Norwegian.