Skip to main content

chinese_province_city_area_mapper

chinese_province_city_area_mapper:一个用于识别简体中文字符串中省,市和区并能够进行映射,检验和简单绘图的python模块

举个例子:

 ["徐汇区虹漕路461号58号楼5楼", "泉州市洛江区万安塘西工业区"]
         ↓ 转换
|省    |市   |区    |地址                 |
|上海市|上海市|徐汇区|虹漕路461号58号楼5楼  |
|福建省|泉州市|洛江区|万安塘西工业区        |

chinese_province_city_area_mapper: built to be recognize Chinese province,city and area in simplified Chinese string, it can automaticall map area to city and map city to province.

for example:

 ["徐汇区虹漕路461号58号楼5楼", "泉州市洛江区万安塘西工业区"]
         ↓ transform
|省    |市   |区    |地址                 |
|上海市|上海市|徐汇区|虹漕路461号58号楼5楼  |
|福建省|泉州市|洛江区|万安塘西工业区        |

完整文档见该模块的Github, GitHub: https://github.com/DQinYuan/chinese_province_city_area_mapper

安装说明

代码目前仅仅支持python3

pip install cpca

Get Started

本模块中最主要的方法是cpca.transform, 该方法可以输入任意的可迭代类型(如list,pandas的Series类型等), 然后将其转换为一个DataFrame,下面演示一个最为简单的使用方法:

location_str = ["徐汇区虹漕路461号58号楼5楼", "泉州市洛江区万安塘西工业区", "北京朝阳区北苑华贸城"]
import cpca
df = cpca.transform(location_str)
df

输出的结果为:

   省     市    区          地址              adcode
0 上海市 上海市  徐汇区     虹漕路461号58号楼5楼  310104
1 福建省 泉州市  洛江区     万安塘西工业区        350504
2 北京市 市辖区  朝阳区     北苑华贸城           110105

如果还想知道更多的细节,请访问该 模块的github地址 https://github.com/DQinYuan/chinese_province_city_area_mapper, 在那里我写了更多的细节

Metadata

Release files for cpca 0.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cpca 0.5.5
File Size Uploaded Provenance
cpca-0.5.5.tar.gz 10.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cpca 0.5.5
File Interpreter ABI Platform
cpca-0.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 86.6 kB

Release files / cpca-0.5.5.tar.gz

Download URL cpca-0.5.5.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a7937e7a30e69d5c5ab6c136ccacc49cb08f199fed93ea5c9a0c51c33d38ed7a
BLAKE2b-256 checksum
How to use checksums
42e69e74380f7449d9c765230c0093ac958989b31f0c14c3520ffa1e61429c8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.3

Release files / cpca-0.5.5-py3-none-any.whl

Download URL cpca-0.5.5-py3-none-any.whl
Size 76.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1635b589506b3e28424032bce61d2488e1f6fac1034a736014e70e043f824fe6
BLAKE2b-256 checksum
How to use checksums
821716287e8fd6d844146d3961201d1f3ed143f03acc4d6ff1b2ced921a2010d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.3

Security for cpca 0.5.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page