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条件调用   类Dog中的java构造函数Dog不能应用于给定类型   java jsch和运行“sudo su”   java将队列和堆栈相互复制   java如何在netbeans项目的文件夹中添加库   java While循环在我的代码中不存在   如何在XML中使用java方法的返回值   java是否可以在不写入文件的情况下将字符串/字节数组作为文件发布?   java为什么这些字符串不相等?   sockets客户机-服务器java编程,用户可选择   java如何在SpringMVC和hibernate中保存模型返回视图的列表   java如何修复组织。openqa。硒。WebDriverException:未知错误   Java,Ant错误:编码Cp1252的不可映射字符   JAVAlang.ClassCastException:[Ljava.lang.String;与java.lang.String不兼容   java如何使用JDK8(可选)为空字段创建自定义IntelliJ getter模板   java Tomcat6响应。sendRedirect()404错误