Skip to content
/ yr-py Public

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

License

Notifications You must be signed in to change notification settings

Abbe98/yr-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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...

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages