WetterOnline API
wetteronline is a Python library which provides unofficial access to the weatherdata hosted on wetteronline.de. It uses webscraping and (hopefully) offers a simple and intuitive API.
Note
This project is under active development. (And so is the documentation too!) Choose carefully, wether you want to write code dependent of this package, functions and attributes might change at any time.
Contents
Installation
First things first, installing the package.
pip
You can install the WetterOnline API via pip in a terminal of your choice:
$ pip install wetteronline
source code
Alternatively the source code is available on Github here. You can clone the repository:
$ git clone https://github.com/johangroe/wetteronline-api.git
Quickstart
Ready to get started?
Basic usage
>> import wetteronline
>> l = wetteronline.location("New York")
>> l.url
"wetter/new-york-city"
>> w = wetteronline.weather("wetter/new-york-city")
>> w.temperature
18 # °C
Advanced usage
>> import wetteronline
>> l = wetteronline.location("New York")
>> l.autosuggests
['New York', 'New York Mills, New York', 'New York, Missouri', 'New York Mills, Minnesota']
>> w = wetteronline.weather(l.url)
>> w.forecast_4d
{'19.06.': {
'maxTemperature': 24,
'minTemperature': 13,
'sunHours': 13,
'precipitationProbability': 10
},
'20.06.': {
'maxTemperature': 27,
'minTemperature': 13,
'sunHours': 13,
'precipitationProbability': 5
},
'21.06.': {
'maxTemperature': 25,
'minTemperature': 15,
'sunHours': 3,
'precipitationProbability': 80
},
'22.06.': {
'maxTemperature': 27,
'minTemperature': 18,
'sunHours': 8,
'precipitationProbability': 50
}
}