Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abbe98/yr-py
Wrapper for the YR.no API, for near time weather prediction.
https://github.com/abbe98/yr-py
weather-prediction yr
Last synced: 7 days ago
JSON representation
Wrapper for the YR.no API, for near time weather prediction.
- Host: GitHub
- URL: https://github.com/abbe98/yr-py
- Owner: Abbe98
- License: mit
- Created: 2016-09-15T13:57:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-01T14:14:24.000Z (about 8 years ago)
- Last Synced: 2024-10-10T18:54:05.381Z (28 days ago)
- Topics: weather-prediction, yr
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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](http://om.yr.no/verdata/vilkar/) which is only available in Norwegian...