Git Product home page Git Product logo

yr-py's Introduction

YR.no API wrapper

Wrapper for the YR.no API, for near time weather prediction.

Installing

pip install yr

Using

Locations

Locations are defined by Geonames, not coordinates:

Example

  • United_States/California/San_Jose
  • Sweden/Södermanland/Himlinge

Periods

Each 24 hours consists of four periods(0-3):

  • 0: 00-06
  • 1: 06-12
  • 2: 12-18
  • 3: 18-24

Code

Retrieving the weather description for a specific period:

w = YR('Sweden/Södermanland/Himlinge')
print(w.getPeriodWeather(1))

partly cloudy

Retrieving the weather description for the current period:

w = YR('Sweden/Södermanland/Himlinge')
print(w.getCurrentWeather())

partly cloudy

Retrieving temperature for a specific period:

t = YR('Sweden/Södermanland/Himlinge')
print(t.getPeriodTemperature(1))

17

Retrieving temperature for the current period:

t = YR('Sweden/Södermanland/Himlinge')
print(t.getCurrentTemperature())

22

Attribution and Terms of Use

You should read and understand the YR.no terms of use which is only available in Norwegian...

yr-py's People

Contributors

abbe98 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

togettech

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.