The most simple way to get China city weather through python.
Project description
weather_china
The most simple way to get China city weather through python. 一行代码查询近7日天气,pip一键安装,数据来源于中国天气网,只支持python3
Install
pip3 install weather_china
Usage
demo:
import weatherChina
# 快速使用
# 主城区
weather=weatherChina.getWeatherByNames('上海','上海')
weather=weatherChina.getWeatherByNames('安徽','合肥','合肥')
# 其它
weather=weatherChina.getWeatherByNames('上海','浦东')
weather=weatherChina.getWeatherByNames('西藏','日喀则','萨迦')
#
print(weather)
# 查看所有地区、以及每个区域的id信息
regionData=weatherChina.getRegionData()
print(regionData)
# 查询地区的id
regionId=weatherChina.getRegionId('北京','朝阳')
regionId=weatherChina.getRegionId('安徽','合肥','合肥')
print(regionId)
# 根据id查询近7日天气
weather=weatherChina.getWeatherById(regionId)
print(weather)
# {'lowTemp': ['3', '5', '0', '1', '3', '4', '2'], 'highTemp': ['14', '15', '10', '9', '14', '17', '18'], 'detail': ['多云', '小雨', '小雨转晴', '晴', '多云转晴', '晴', '晴']}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
weatherChina-0.0.0.2.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for weatherChina-0.0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b99111f346cec323846ad1cc6f981bc9354a6850d00a0c6625e7d0128bb503b7 |
|
MD5 | d77f7d08d352a6bceab1bb5dff66e127 |
|
BLAKE2b-256 | a3c732369fd746b4d9e7687d256012010366cba9aa7c81deccf41410003ee76d |