Skip to main content

中国行政区域数据

Project description

中国行政区域数据

根据中华人民共和国民政部中的数据处理而成。

由于时间跨度过长(从 1980 年至今),故而部分地区的名称或行政级别已经发生改变,本仓库的存储原则为“编码唯一,以新换旧”。即同一个行政编码,认定为同一个地区,地区名称以民政部门最新公开的行政区域划分数据中的名称为准。且,为保持向前兼容,一些过去存在但后来去除的行政区域编码,本仓库仍然保留,以方便一些古旧的数据能正常使用。

安装

pip install china-region-data

样例

from china_region_data import 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

北京 = Region("110000")
assert 北京.name == 北京.fullname == "北京市"
assert 北京 not 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-2020.10.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

china_region_data-2020.10-py3-none-any.whl (54.3 kB view details)

Uploaded Python 3

File details

Details for the file china-region-data-2020.10.tar.gz.

File metadata

  • Download URL: china-region-data-2020.10.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.4 Windows/10

File hashes

Hashes for china-region-data-2020.10.tar.gz
Algorithm Hash digest
SHA256 2098a1fdc620ff2f2049575b1da2db5e2d3068264c6bb82c04728aba8b75565b
MD5 0c30bcb22f8b29df50c5ddfdaac40cb5
BLAKE2b-256 b2d369b0335f05d21dc5a5d4b9ae36c43e1ceeb07d2f99fdbe2e8a187880bc0f

See more details on using hashes here.

File details

Details for the file china_region_data-2020.10-py3-none-any.whl.

File metadata

File hashes

Hashes for china_region_data-2020.10-py3-none-any.whl
Algorithm Hash digest
SHA256 dab54d96567c904a7d93c8bdadd7e2743bc746cf40e7083c530a60495e1060b2
MD5 6beb3281e0234a5f3127da7378a9f8fa
BLAKE2b-256 ad3f4b3352d41ec5c50c174a978e60cc35bbf959009f2668545a9e929a5ed81d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page