moskytw / zipcodetw Goto Github PK
View Code? Open in Web Editor NEWFind Taiwan ZIP code by address fuzzily.
License: MIT License
Find Taiwan ZIP code by address fuzzily.
License: MIT License
復興南路二段 is entirely in 大安區, so a better result would be 106 instead of 10.
I can see a few pull requests on level 1 token but I am not sure they are related or not.
剛好測到這特殊測資,就來開 Issue 了 👍
I tried to install zipcodetw, however, the installation failed due to No module named 'six'
even if there is six
in my requirements.txt
. The code causing the problem is at line 7 of util.py
. Is there any solution?
Hi,
I try to use below code on colab:
try:
import zipcodetw
except ImportError:
!pip install zipcodetw
import zipcodetw
zipcodetw.find('臺北市信義區市府路1號')
but colab shows "util.py line 363, OperationalError: no such table: precise"
Is any way to work on colab?
Thanks.
more debug message:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting zipcodetw
Downloading zipcodetw-0.6.8.tar.gz (592 kB)
|████████████████████████████████| 592 kB 7.7 MB/s
Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from zipcodetw) (1.15.0)
Collecting unicodecsv
Downloading unicodecsv-0.14.1.tar.gz (10 kB)
Building wheels for collected packages: zipcodetw, unicodecsv
Building wheel for zipcodetw (setup.py) ... done
Created wheel for zipcodetw: filename=zipcodetw-0.6.8-py3-none-any.whl size=610897 sha256=8e8739c0bd79c942aaf817780ebf89acc61ad3d7a90bcd0c81cf3bd47b41cbb7
Stored in directory: /root/.cache/pip/wheels/37/03/5b/638651b1773a38a94b3a63284267f5bf248af9954dc617f8cd
Building wheel for unicodecsv (setup.py) ... done
Created wheel for unicodecsv: filename=unicodecsv-0.14.1-py3-none-any.whl size=10768 sha256=84c4ba5866616b0e6f7d2821a0cfce99c4dcd26e8a3a178974cdcf096aeb943d
Stored in directory: /root/.cache/pip/wheels/1a/f4/8a/a5024fb77b32ed369e5c409081e5f00fbe3b92fdad653f6e69
Successfully built zipcodetw unicodecsv
Installing collected packages: unicodecsv, zipcodetw
Successfully installed unicodecsv-0.14.1 zipcodetw-0.6.8
OperationalError Traceback (most recent call last)
in ()
5 import zipcodetw
6
----> 7 zipcodetw.find('臺北市信義區市府路1號')
2 frames
/usr/local/lib/python3.7/dist-packages/zipcodetw/util.py in get_rule_str_zipcode_pairs(self, addr_str)
361 from precise
362 where addr_str = ?;
--> 363 ''', (addr_str,))
364
365 return self.cur.fetchall()
OperationalError: no such table: precise
Currently, new installations in a clean virtualenv on Python 3.9.7 would result in the following error:
File "/private/var/folders/…/zipcodetw/builder.py", line 23, in build
dir_.load_chp_csv(csv_f)
File "/private/var/folders/…/zipcodetw/util.py", line 317, in method_wrapper
retval = method(self, *args, **kargs)
File "/private/var/folders/…/zipcodetw/util.py", line 340, in load_chp_csv
for row in csv.reader(lines_iter):
File "/Users/…/zipcode_test/venv/lib/python3.9/site-packages/unicodecsv/py3.py", line 55, in __next__
return self.reader.__next__()
File "/Users/…/zipcode_test/venv/lib/python3.9/site-packages/unicodecsv/py3.py", line 51, in <genexpr>
f = (bs.decode(encoding, errors=errors) for bs in f)
AttributeError: 'str' object has no attribute 'decode'
----------------------------------------
Running pip remove unicodecsv && python -m zipcodetw.builder
fixed the issue.
It appears that unicodecsv
has been abandoned as in jdunck/python-unicodecsv#92, and thus no further maintenance are done for the package.
We could either:
csv
backport from Python 3, orunicodecsv
as our dependency only when Python version < 3 as shown in PEP 0508.The last one should be the easiest mitigation. Please let me know if a PR is preferred over issues.
When I was running on .py file, everything went great. However, after converting my .py to .exe and executing the .exe file, it pops out the error message.
File "site-packages\zipcodetw\util.py", line 313, in method_wrapper
sqlite3.OperationalError: unable to open database file
Is there any solution?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.