Skip to content

Get the forecast from the norwegian weather service yr.no in python

License

Notifications You must be signed in to change notification settings

clemefr/python-yr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-yr

Library for the norwegian weather service YR.no in Python.

Install (easiest way)

pip3 install python-yr

Usage

from yr.libyr import Yr

weather = Yr(location_name='Norge/Telemark/Skien/Skien')
now = weather.now(as_json=True)

print(now)

This returns

{
    "@from": "2014-06-04T08:00:00",
    "@to": "2014-06-04T12:00:00",
    "@period": "1",
    "symbol": {
        "@number": "3",
        "@numberEx": "3",
        "@name": "Partly cloudy",
        "@var": "03d"
    },
    "precipitation": {
        "@value": "0",
        "@minvalue": "0",
        "@maxvalue": "0.1"
    },
    "windDirection": {
        "@deg": "159.4",
        "@code": "SSE",
        "@name": "South-southeast"
    },
    "windSpeed": {
        "@mps": "1.3",
        "@name": "Light air"
    },
    "temperature": {
        "@unit": "celsius",
        "@value": "13"
    },
    "pressure": {
        "@unit": "hPa",
        "@value": "1012.1"
    }
}

For more usage examples visit folder examples or project wiki

Pull requests

Please everyone involved to generate demands and plans (pull requests), so we could set targets for next version 1.5 ;)

Branches

  • develop, the main (default) branch for development on GitHub
  • master, branch for the stable release published on PyPi
  • python2, branch with support for Python2
  • csv-support, branch with support for CSV export forecasts
  • ...

About

Get the forecast from the norwegian weather service yr.no in python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%