Skip to content

Latest commit

 

History

History
executable file
·
62 lines (51 loc) · 1.32 KB

File metadata and controls

executable file
·
62 lines (51 loc) · 1.32 KB

python-ayr

Asynchronous library for the norwegian weather service YR.no in Python. Forked from python-yr by wkcd_.

Usage

from ayr.libayr import Yr

weather = Yr(location_name='Norge/Telemark/Skien/Skien')
now = await 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"
    }
}