Skip to main content

这是一个专门从文本里面提取中国的省,市,县的一个python模块

例子:

from get_province_city_county import get_city
citys=get_city("我出生在一个名字叫安徽的省份,我去过浙江,江苏,合肥还有淮南,但我最喜欢的还是合肥,因为我在蜀山区生活过一段时间")
print(citys)

结果:('安徽省', 5, '合肥市', 3, '蜀山区', 1)

你也可以通过h_zd参数来指定要提取的省市范围,将提取范围缩小,以便得到更精确的结果

例子:

from get_province_city_county import get_city
citys=get_city("我出生在一个名字叫安徽的省份,我去过浙江,江苏,台州,合肥还有淮南,但我最喜欢的还是合肥,因为我在蜀山区生活过一段时间",h_zd="浙江")
print(citys)

结果:

('浙江省', 3, '台州市', 1, '', 0)

通过h_zd这个参数,就可以锁定范围了

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

get_province_city_county-0.7.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

get_province_city_county-0.7.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file get_province_city_county-0.7.0.tar.gz.

File metadata

  • Download URL: get_province_city_county-0.7.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.6

File hashes

Hashes for get_province_city_county-0.7.0.tar.gz
Algorithm Hash digest
SHA256 fd02f00c56ea559792f3abb84bf9a932f8b36c85bdb5e33e129ea88cc0d4a34c
MD5 35e005df1eb63e4b69a685dbb8faf749
BLAKE2b-256 68b7f9cbdb8b31c642a257288d4b097bc9cad3a67b5e2a85c3e94018e99eb829

See more details on using hashes here.

File details

Details for the file get_province_city_county-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: get_province_city_county-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.6

File hashes

Hashes for get_province_city_county-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e52648ea0c77d8c16b3d9441424a7787c2598ae460b453e83148b827810898c6
MD5 d44e9abc030fbee1d2d05545403e1a76
BLAKE2b-256 9d118472622f07dfcb81882cc4a8cee3b4ddf364980d4a294935ea48ca1eb33c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page