A parser for Canadian postal addresses
Project description
ez-address-parser
A parser for Canadian postal addresses
Install
From PyPi
pip install ez-address-parser
From GitHub
pip install git+https://github.com/zehengl/ez-address-parser.git
Usage
Command Line
python -m ez_address_parser --address <some-address>
Code (with pretrained model)
from ez_address_parser import AddressParser
ap = AddressParser()
address = input("Address: ")
result = ap.parse(address)
for token, label in result:
print(f"{token:20s} -> {label}")
Code (without pretrained model)
from ez_address_parser import AddressParser
ap = AddressParser(use_pretrained=False)
data = [
[
('123', 'StreetNumber'),
('Main', 'StreetName'),
('St', 'StreetType'),
('E', 'StreetDirection')
],
...
] # list of list of (<token>, <label>) tuple
ap.train(data)
address = input("Address: ")
result = ap.parse(address)
for token, label in result:
print(f"{token:20s} -> {label}")
Credits
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ez-address-parser-0.2.5.tar.gz
(33.1 kB
view details)
Built Distribution
File details
Details for the file ez-address-parser-0.2.5.tar.gz
.
File metadata
- Download URL: ez-address-parser-0.2.5.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddd2bf780615ef788dd3ed3560c6f75dfab2c930efa48076b13b1fca3d9943cc |
|
MD5 | 65cfa8516215c33a3b904a6c7092d78b |
|
BLAKE2b-256 | 156616892aca8c8a1e5125791be1bd3ce5e328bab7d3e6ac494008b07435b183 |
File details
Details for the file ez_address_parser-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: ez_address_parser-0.2.5-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a5c958971276e6046da530d6c10cbdaddb704ca8a2f818fbb50b76d5842333 |
|
MD5 | 61919bb0fafe9066e9915d368ce1ed25 |
|
BLAKE2b-256 | 770f4a5cf69747c27faf64963f46800edd1ae28999df8171980c4a6aa803047d |