Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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

Project Description

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

Changelog

1.4.5 (2016 May 19)

  • Parse the ‘nextrun’ field from the cache file as UTC time (API_Locationforecast)

1.4.4 (2016 May 06)

1.4.2 (2015 Apr 21)

  • add remove function to Cache
  • add explicit installation of language-specific JSON files to setup ~> thanx to kurisuke
  • check the freshness of cache based on nextupdate tag in meta ~> thanx to knightsamar

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
Release History

Release History

This version
History Node

1.4.5

History Node

1.4.4

History Node

1.4.3

History Node

1.4.2

History Node

1.4.1

History Node

1.4.0

History Node

1.3.2

History Node

1.3.1.1

History Node

1.3.1

History Node

1.2.2-dev

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
python-yr-1.4.5.tar.gz (19.7 kB) Copy SHA256 Checksum SHA256 Source May 19, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting