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.5.0.tar.gz (45.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.5.0-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: get_province_city_county-0.5.0.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

File hashes

Hashes for get_province_city_county-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a486eb91b0234c3864425988d8ddbdc10c67543e1e823612a11d0406cbfd335d
MD5 8423aeb410b19f6d85f0497fbe63da0e
BLAKE2b-256 8799e5c11e03b51dd2b84591db6056c4b381ce1feb1add98001240aabc55c298

See more details on using hashes here.

File details

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

File metadata

  • Download URL: get_province_city_county-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

File hashes

Hashes for get_province_city_county-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eadd4283b34c5db03d736714c38758f8070dacef6b0f01de9e8aa29c292db416
MD5 a9f8b53651621559a2c056fda446dc4a
BLAKE2b-256 26659b9901a2995c9cdd03569cec2d6def9a5c61f9df4b041a983f7d9db81e36

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 Pingdom Monitoring Sentry Error logging StatusPage Status page