weatherChina
The most simple way to get China city weather through python. 一行代码查询近7日天气,pip一键安装,数据来源于中国天气网,只支持python3
Install
pip3 install weatherChina
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': ['多云', '小雨', '小雨转晴', '晴', '多云转晴', '晴', '晴']}
Release files for weatherChina 0.0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| weatherChina-0.0.0.6.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| weatherChina-0.0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 63.2 kB
Release files / weatherChina-0.0.0.6.tar.gz
| Download URL | weatherChina-0.0.0.6.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5716356e5121241d69663900c2584f30c257a2fe9e097a220c172867709f0a22
|
|
BLAKE2b-256 checksum How to use checksums |
19a2c280923d7036852cf3daf6be2010e96eb7ae661a9113433a58cd888304e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.6
|
Release files / weatherChina-0.0.0.6-py3-none-any.whl
| Download URL | weatherChina-0.0.0.6-py3-none-any.whl |
|---|---|
| Size | 59.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba260e22515d3ce92a71f807459bdf92926bcccccd4d7bde41d5014b30cb48b1
|
|
BLAKE2b-256 checksum How to use checksums |
c1774ae54301c23d45f0eff81b1d43e5aca5af93b28db04c77207fd868972695
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.6
|