Find Taiwan ZIP code by address fuzzily.
Project description
The ZIP Code Finder for Taiwan
This package lets you find ZIP code by address in Taiwan.
The main features:
Fast. It builds ZIP code index by tokenization.
Gradual. It returns partial ZIP code rather than noting when address is not detailed enoguh.
Lightweight. It depends on nothing.
Usage
Find ZIP code gradually:
>>> import zipcodetw
>>> zipcodetw.find('臺北市')
'1'
>>> zipcodetw.find('臺北市信義區')
'110'
>>> zipcodetw.find('臺北市信義區市府路')
'110'
>>> zipcodetw.find('臺北市信義區市府路1號')
'11008'
After v0.3, you can find ZIP code fuzzier:
>>> zipcodetw.find('松山區')
'105'
>>> zipcodetw.find('秀山街')
''
>>> zipcodetw.find('台北市秀山街')
'10042'
Installation
It is available on PyPI:
$ sudo pip install zipcodetw
Just install it and have fun. :)
Data
The ZIP code directory we use is provided by Chunghwa Post, and is available from: http://www.post.gov.tw/post/internet/down/index.html#1808
Changelog
v0.3
It builds full index for middle tokens; and
also normalizes Chinese numerals now!
zipcodetw.find is ~1.06x faster.
But initiation time increases to ~1.7x.
v0.2
zipcodetw.find is 8x faster now!
It has a better tokenizing logic; and
a better matching logic for sub-number now.
zipcodetw.find_zipcodes was removed.
Internal API was changed a lot.
The tests are better now.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file zipcodetw-0.3.tar.gz
.
File metadata
- Download URL: zipcodetw-0.3.tar.gz
- Upload date:
- Size: 428.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef251bbde6851303a4a3e8ae70233936401f84304e51ab9d37eadc744539eda0 |
|
MD5 | 626f26fd998bcec835cd93b6ac4a04cd |
|
BLAKE2b-256 | e90fee7bd5c915c412c26294e8a9a31d3b66e27222f77ff0f17a5924c5eaf3b8 |