中国行政区域数据
Project description
中国行政区域数据
根据中国政府网站中的数据处理而成。
install
pip3 install china-region-data
example
from china_region_data import provinces, cities, counties, Region
广东 = Region("广东省")
深圳 = Region("深圳市")
南山 = Region("南山区")
assert 广东.name == "广东省"
assert 广东.level == 1
for 广东城市 in 广东.subordinate:
assert 广东城市.level == 2
assert 深圳.superior == 广东
assert 南山.superior.superior == 广东
assert 南山 in 南山.superior
assert 南山 in 南山.superior.superior
assert not Region("合肥市") in 广东
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
china-region-data-0.2.0.tar.gz
(32.2 kB
view hashes)
Built Distribution
Close
Hashes for china_region_data-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd6f0b94b54c599ac701c8978d574a0483d32e43c6222cade018c3099216f5d2 |
|
MD5 | e567a7062743b28c47596a92700043a5 |
|
BLAKE2b-256 | 6c174801d086217e7dcfa6334b20b5a23f845a70367b078e417bfdd9516ccbd7 |