Skip to main content

fastwork

致力于让你繁琐的工作自动化,让你有更多的精力和时间去提升自己的认知和影响力。 欢迎关注我的微信公众号:人文互联网。

安装

pip install china-district

依赖库

requests=2.22.0

基础使用示例

基础使用,默认使用作者自己的高德地图开发者key,每天上限调用30万次。超过这个限制将无法使用。

>>> In [1]: from china_district import District
# 初始化District,默认只返回下一级行政区,不返回行政区边界坐标点
>>> In [2]: d=District()

>>> In [3]: d.get("武侯区")
{'status': '1',
 'info': 'OK',
 'infocode': '10000',
 'count': '1',
 'suggestion': {'keywords': [], 'cities': []},
 'districts': [{'citycode': '028',
   'adcode': '510107',
   'name': '武侯区',
   'center': '104.05167,30.630862',
   'level': 'district',
   'districts': [{'citycode': '028',
     'adcode': '510107',
     'name': '金花桥街道',
     'center': '103.973,30.6029',
     'level': 'street',
     'districts': []},
……}
# 将当前搜索结果(json对象)写入到当前目录,默认文件名"搜索关键词.json"
>>> d.to_json("武侯区")
	写入本地完成...

高级使用示例

>>> In [1]: from china_district import District
# 初始化District,key为高德地图开发者key,subdistrict设置显示下级行政区级数,extensions设置行政区信息中是否返回行政区边界坐标点,”base"不返回,“all"返回

>>> In [5]:d = District(key="182ad5d7061ed1e421091c22089c3677",subdistrict=3,extensions="all")

Out[6]: 
{'status': '1',
 'info': 'OK',
 'infocode': '10000',
 'count': '1',
 'suggestion': {'keywords': [], 'cities': []},
 'districts': [{'citycode': '028',
   'adcode': '510107',
   'name': '武侯区',
   'polyline': '103.949841,30.658586;103.949928,30.658864;103.950137,30.659044;103.950415,30.659121;103.950667,30.6591;103.952425,30.658587;103.952869,30.658525;103.95333,30.658589;103.953
687,30.658726;103.953966,30.658948;103.954261,30.659335;103.954984,30.660906;103.955149,30.661113;103.955472,30.661348;103.95575,30.661423;103.956107,30.661436;103.957439,30.661364;103.957……```}

请求参数说明

了解更多

高德地图行政区域查询接口:https://lbs.amap.com/api/webservice/guide/api/district

License

Licensed under the MIT License.

Metadata

Release files for fastwork 0.0.4

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

Source distribution (sdist)

Source distribution for fastwork 0.0.4
File Size Uploaded Provenance Actions
fastwork-0.0.4.tar.gz 6.1 kB Without provenance Details for fastwork-0.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 20.2 kB

Release files / fastwork-0.0.4.tar.gz

Download URL fastwork-0.0.4.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d8277f2920c36f4df3ece89f77a2fe58ca6d3e024b14068fadf47ee75ade5145
BLAKE2b-256 checksum
How to use checksums
9fc974041aba502535c4de66d90d2d57e94658538ad8d814a83685370649add6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.8

Release files / fastwork-0.0.4-py3-none-any.whl

Download URL fastwork-0.0.4-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e6e2ca7f46839cca9fa13ba13e68f301126d30a60fc3b87fd30998e9c03c0be
BLAKE2b-256 checksum
How to use checksums
d9def4b8f8903966776883ec00e1b48d302bc5d0f362d6e8ce62cf675a981dbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.8

Security for fastwork 0.0.4

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

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