https://github.com/zehengl/ez-address-parser
A parser for Canadian postal addresses
https://github.com/zehengl/ez-address-parser
address-parser canadian conditional-random-fields python
Last synced: 21 days ago
JSON representation
A parser for Canadian postal addresses
- Host: GitHub
- URL: https://github.com/zehengl/ez-address-parser
- Owner: zehengl
- License: mit
- Created: 2020-01-07T19:17:40.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-06-10T15:12:34.000Z (about 1 month ago)
- Last Synced: 2025-06-22T19:08:08.482Z (21 days ago)
- Topics: address-parser, canadian, conditional-random-fields, python
- Language: Python
- Homepage: https://pypi.org/project/ez-address-parser/
- Size: 4.21 MB
- Stars: 19
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# ez-address-parser
[](https://github.com/zehengl/ez-address-parser/actions/workflows/pytest.yml)




[](https://pepy.tech/project/ez-address-parser)
[](https://github.com/zehengl/ez-address-parser/actions/workflows/gh-deploy.yml)A parser for Canadian postal addresses
## Install
From [PyPi](https://pypi.org/project/ez-address-parser/)
pip install ez-address-parser
From [GitHub](https://github.com/zehengl/ez-address-parser)
pip install git+https://github.com/zehengl/ez-address-parser.git
## Usage
### Command Line
python -m ez_address_parser --address
### Code (with pretrained model)
```python
from ez_address_parser import AddressParserap = AddressParser()
address = input("Address: ")
result = ap.parse(address)
for token, label in result:
print(f"{token:20s} -> {label}")
```### Code (without pretrained model)
```python
from ez_address_parser import AddressParserap = AddressParser(use_pretrained=False)
data = [
[
('123', 'StreetNumber'),
('Main', 'StreetName'),
('St', 'StreetType'),
('E', 'StreetDirection')
],
...
] # list of list of (, ) tupleap.train(data)
address = input("Address: ")
result = ap.parse(address)
for token, label in result:
print(f"{token:20s} -> {label}")
```## Credits
- [Icon][1] by [Rakhmat Setiawan][2]
[1]: https://www.iconfinder.com/icons/3059893/find_magnifier_search_seo_word_icon
[2]: https://www.iconfinder.com/rsetiawan93