从python中的挪威wheather service yr.no获取预测
python-yr的Python项目详细描述
挪威气象局图书馆。
安装(最简单的方法)
pip3 install python-yr
用法
fromyr.libyrimportYrweather=Yr(location_name='Norge/Telemark/Skien/Skien')now=weather.now(as_json=True)print(now)
返回
{"@from":"2014-06-04T08:00:00","@to":"2014-06-04T12:00:00","@period":"1","symbol":{"@number":"3","@numberEx":"3","@name":"Partly cloudy","@var":"03d"},"precipitation":{"@value":"0","@minvalue":"0","@maxvalue":"0.1"},"windDirection":{"@deg":"159.4","@code":"SSE","@name":"South-southeast"},"windSpeed":{"@mps":"1.3","@name":"Light air"},"temperature":{"@unit":"celsius","@value":"13"},"pressure":{"@unit":"hPa","@value":"1012.1"}}
拉取请求
请所有相关人员生成需求和计划(拉取请求),以便我们可以为下一版本1.5;设定目标。
更改日志
1.4.5(2016年5月19日)
- 将缓存文件中的“nextrun”字段解析为UTC时间(API位置预测)
1.4.4(2016年5月6日)
-
LI>转换APIL定位预测到^ {A11} -固定>34</LI>
1.4.2(2015年4月21日)
- 将删除功能添加到缓存
- 将特定于语言的json文件的显式安装添加到setup~>;thanx到kurisuke
- 基于meta~>;thanx toknightsamar中的nextupdate标记检查缓存的新鲜度
1.4.1(2014年12月11日)
- 添加日志记录支持
- 修改一些变量
- mod捕捉异常
- 将locationxyz功能重写为API位置预测
- 交换经纬度
- 添加self.coordinates
- 添加self.location_name ~>;不理想,因此将来可能会发生变化
- 在api上添加locationxyz包装器以获得向后兼容性
- 临时文件的mod hash名称
- 改进setup.py
- mod readme from markdown to restructuredtext
1.4.0(2014年9月12日)
- 添加对yr.no api服务的支持~>;感谢lucadelu
- 添加小时预测~>;感谢antorweep1987
1.3.2(2014年7月11日)
- 改进异常处理~>;感谢mbambas
1.3.1.1(2014年7月10日)
- 错误修复:“setup.py”中的pypi/pip安装程序
1.3.1(2014年7月10日)
- 错误修复:is fresh函数中的缓存机制~>;感谢antorweep1987
- 改进示例