X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/blobdiff_plain/bc07cbc61c74ba84791b67b170b43b293aa7230e..26256314244db4e501c6514d46ee65b88d65675c:/owm.py diff --git a/owm.py b/owm.py index 5d5a77c..d97d57e 100755 --- a/owm.py +++ b/owm.py @@ -6,6 +6,8 @@ # cityid=.. # 3319578 for Obsteig, AT +# needed packaes: python3-mysqldb python3-sqlalchemy + from pprint import pprint import argparse import configparser @@ -50,7 +52,7 @@ def extractweatherdata(w): data['winddegrees'] = w['wind']['deg'] if 'deg' in w['wind'] else math.nan data['winddirection'] = degToCompass(data['winddegrees']) - data['precipitation'] = w['rain']['3h'] if 'rain' in w else math.nan + data['precipitation'] = w['rain']['3h'] if 'rain' in w and w['rain'].get('3h') else math.nan data['visibility'] = w.get('visibility', math.nan) return data