Skip to main content

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

Project description

Library for the norwegian wheather service yr.no in python.

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 are very welcomed! :-)

Changelog

1.4.1 (2014 Dec 11)

  • add logging support

  • mod some variables

  • mod catching exceptions

  • rewrite LocationXYZ functionality to API_Locationforecast
    • swap longitude and latitude

    • add self.coordinates

    • add self.location_name ~> not ideal, so it will probably change in future

  • add LocationXYZ wrapper over API_Locationforecast for backward compatibility

  • mod hash names for temporary files

  • improve setup.py

  • mod README from Markdown to reStructuredText

1.4.0 (2014 Sep 12)

1.3.2 (2014 Jul 11)

  • improve exception-handling ~> thanks to mbambas

1.3.1.1 (2014 Jul 10)

  • bugfix: pypi/pip installer in ‘setup.py’

1.3.1 (2014 Jul 10)

  • bugfix: caching mechanism in ‘is_fresh’ function ~> thanks to antorweep1987

  • improve examples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-yr-1.4.1.tar.gz (18.6 kB view details)

Uploaded Source

File details

Details for the file python-yr-1.4.1.tar.gz.

File metadata

  • Download URL: python-yr-1.4.1.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-yr-1.4.1.tar.gz
Algorithm Hash digest
SHA256 e14a7caa13597f70fa02fc2d3d6266016662a656212be5c573dd39f756b64e12
MD5 b00258282c7be2cc65efe9d090db1792
BLAKE2b-256 b921569d4f31449cfe06acdb5554facfa29fe82fde62cb974139e23c4bddb324

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page