Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T12:32:47.000Z (9 months ago)
- Last Synced: 2024-04-22T13:49:22.755Z (9 months ago)
- Topics: address-parser, canadian, conditional-random-fields, python
- Language: Python
- Homepage: https://pypi.org/project/ez-address-parser/
- Size: 3.4 MB
- Stars: 15
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ez-address-parser
[![pytest](https://github.com/zehengl/ez-address-parser/actions/workflows/pytest.yml/badge.svg)](https://github.com/zehengl/ez-address-parser/actions/workflows/pytest.yml)
![coding_style](https://img.shields.io/badge/code%20style-black-000000.svg)
![PyPI - License](https://img.shields.io/pypi/l/ez-address-parser)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ez-address-parser)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/ez-address-parser)
[![Downloads](https://static.pepy.tech/badge/ez-address-parser)](https://pepy.tech/project/ez-address-parser)
[![GitHub Pages](https://github.com/zehengl/ez-address-parser/actions/workflows/gh-deploy.yml/badge.svg)](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