提供苏黎世水保警察现场和历史天气数据。

fhnw-ds-hs2019-weatherstation-api的Python项目详细描述


此库提供对Wasserschutzpolizei Zurich实时(使用此REST API)和历史(使用这些CSV files)天气数据的访问。

安装

sudo pip3 install fhnw_ds_hs2019_weatherstation_api

下载历史数据

mkdir data &&cd data
wget https://raw.githubusercontent.com/markif/WeatherStation_HS2019/master/data/messwerte_mythenquai_2007-2018.csv
wget https://raw.githubusercontent.com/markif/WeatherStation_HS2019/master/data/messwerte_tiefenbrunnen_2007-2018.csv
wget https://raw.githubusercontent.com/markif/WeatherStation_HS2019/master/data/messwerte_mythenquai_2019.csv
wget https://raw.githubusercontent.com/markif/WeatherStation_HS2019/master/data/messwerte_tiefenbrunnen_2019.csv
cd ..

用法

#!/usr/bin/env python3# import the libraryfromfhnw_ds_hs2019_weatherstation_apiimportdata_importasweatherimportos# DB and CSV configconfig=weather.Config()# define CSV pathconfig.historic_data_folder='.'+os.sep+'data'# set batch size for DB inserts (decrease for raspberry pi)config.historic_data_chunksize=10000# define DB hostconfig.db_host='localhost'# connect to DBweather.connect_db(config)# clean DBweather.clean_db(config)# import historic dataweather.import_historic_data(config)# import latest data (delta between last data point in DB and current time)weather.import_latest_data(config)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java中char的用途   swing修复,以便显示可以同时显示十进制数和整数   java给定一个场景,找到拥有的JFXPanel   java JPA 2标准获取路径导航   java如何用JUnit测试这个类?   JSF中的java请求作用域   Spring云Zuul代理背后的java Spring OAuth授权服务器   java限制聚合返回的存储桶大小   java如何在安卓应用程序中请求超级su权限   防止超级关键字的java Checkstyle规则   java 安卓。应用程序。应用程序无法强制转换到安卓。应用程序。在回收器适配器中使用FragmentManager时的活动   使用Java的Twitter广告API   切换到4.0.1版本后,java“JavaMailSenderImpl无法解析为类型”   java没有getter方法可用于名称下bean的属性   java 0/1背包堆空间   java我无法使用断点进行调试   Jar文件名表单java代码   java调用从扩展活动的MainActivity类扩展片段的类片段