OpenWeatherAPI的一个调用、当前和预测5服务的迷你python包装器。

sunnyside的Python项目详细描述


日光浴

GitHub releasePython Version

安装

pip3 install sunnyside

入门

Python版本

Sunnyside只支持python3.6+


^{pr2}$

当前天气

https://openweathermap.org/current

城市名称天气

Note:单位默认以开尔文为单位,将单位更改为英制或摄氏度。在

weather=ref.current_weather()response=weather.get_current_weather_by_city_name("city_name")# Enter your city name here

城市id的天气

response=weather.get_current_weather_by_city_id("city_id")

气象坐标

response=weather.get_current_weather_by_geo_coords("lat","lon")

邮政编码天气

response=weather.get_current_weather_by_zip_code("zipcode")

5天天气预报

https://openweathermap.org/forecast5

城市名称天气

forecast=ref.five_day_forecast()response=forecast.get_forecast_by_city_name("some_city_name_here")

城市id的天气

response=forecast.get_forecast_by_city_id("city_id")

气象坐标

response=forecast.get_forecast_by_geo_coords("lat","lon")

邮政编码天气

response=forecast.get_forecast_by_zip_code("zipcode")

一个电话

https://openweathermap.org/api/one-call-api

从一次调用api获取天气数据

openweather=ref.one_call()response=openweather.get_weather("33.441792","-94.037689")

参考文献

https://openweathermap.org/api

https://openweathermap.org/current

https://openweathermap.org/forecast5

https://openweathermap.org/api/one-call-api

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

推荐PyPI第三方库


热门话题
我们可以使用java for loop with switch语句。。?   java如何从具有循环关系的数据集生成树?   使用s:mvcUrl标记时java Spring启动问题   javascript Wicket调色板水平滚动条在firefox中不显示   java如何清理Maven插件绑定?   java将文件从设备发送到计算机不起作用(文件被破坏)   Java GPU编程的性能   java字符串标记器问题   连接Java LDAP断开连接   java Android GridView将无法确定正确的位置   java AlarmManager在指定时间未显示toast消息   MVC中的java测试外观|断言返回类型   logcat上的java Android运行时错误   java Building Workspace在Eclipse中遇到错误   堆栈溢出尾部递归遗传算法抛出“awteventque0”java。StackOverflowerr语言   java ArrayOutOfBounds测试代码不工作   java有没有像Moodle这样流行的课程管理系统?   java如何从jsp获取xml文件作为响应