中国行政区域数据
Project description
中国行政区域数据
根据中国政府网站中的数据处理而成。
install
pip3 install china-region-data
example
from china_region_data import 省级行政区域, 市级行政区域, 县级行政区域, Region
for 省级行政地区 in 省级行政区域:
print(省级行政地区)
for 市级行政地区 in 省级行政地区.下级行政区域:
print(" ", 市级行政地区)
for 县级行政地区 in 市级行政地区.下级行政区域:
print(" ", 县级行政地区)
广东 = Region("广东省")
深圳 = Region("深圳市")
南山 = Region("南山区")
assert 广东.name == "广东省"
assert 广东.行政级别 == 1
for 广东城市 in 广东.下级行政区域:
assert 广东城市.行政级别 == 2
assert 深圳.上级行政地区 == 广东
assert 南山.上级行政地区.上级行政地区 == 广东
assert 南山 in 南山.上级行政地区
assert 南山 in 南山.上级行政地区.上级行政地区
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.1.4.tar.gz
(30.9 kB
view hashes)
Built Distribution
Close
Hashes for china_region_data-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27e2c6da14613c65aba38bcac51258c3b6ee99500304c44a175b3bc163a7c686 |
|
MD5 | 42e14eccfeb68094e432e7c8871ad722 |
|
BLAKE2b-256 | 0ff6adbe3a2d3e243f0776ffd09b11e8d6785d0908729713e0e5b00ffaa6edd4 |