X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/blobdiff_plain/07f6fd2c6041d6203380a60771ce1cffdc2f68a7..c078b6b5f231a2e7da614bcc6efcd0bb03c2fbeb:/owm.py diff --git a/owm.py b/owm.py index 3265f20..74fe6c4 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 @@ -91,7 +93,7 @@ def write_db(config, url, weather_json, weather_data): sql = 'insert ignore into openweathermap ({}) values ({})'.format(', '.join(sql_columns), ','.join(['%s'] * len(sql_columns))) with warnings.catch_warnings(): # ignore _mysql_exceptions.Warning: Duplicate entry '3319578-2018-08-01 20:50:00' for key 'cityid_datetime' - warnings.simplefilter("ignore", category=MySQLdb.cursors.Warning) + warnings.simplefilter("ignore", category=MySQLdb.cursors.Warning) conn.execute(sql, *sql_values) conn.close()