랭킹으로 돌아가기

datamade/usaddress

Pythonparserator.us/usaddress

:us: a python library for parsing unstructured United States address strings into address components

python-libraryaddressnlpparseratorpythonaddress-parsernatural-language-processingmachine-learningconditional-random-fieldscrf
스타 성장
스타
1.6k
포크
308
주간 성장
이슈
169
5001k1.5k
2014년 8월2018년 7월2022년 7월2026년 7월
아티팩트PyPIpip install usaddress
README

usaddress

usaddress is a Python library for parsing unstructured United States address strings into address components, using advanced NLP methods.

What this can do: Using a probabilistic model, it makes (very educated) guesses in identifying address components, even in tricky cases where rule-based parsers typically break down.

What this cannot do: It cannot identify address components with perfect accuracy, nor can it verify that a given address is correct/valid.

It also does not normalize the address. However, this library built on top of usaddress does.

Tools built with usaddress

Parserator API

A RESTful API built on top of usaddress for programmers who don't use python. Requires an API key and the first 1,000 parses are free.

Parserator Google Sheets App

Parserator: Parse and Split Addresses allows you to easily split addresses into separate columns by street, city, state, zipcode and more right in Google Sheets.

How to use the usaddress python library

  1. Install usaddress with pip, a tool for installing and managing python packages (beginner's guide here).

In the terminal,

pip install usaddress
  1. Parse some addresses!

usaddress

Note that parse and tag are different methods:

import usaddress
addr='123 Main St. Suite 100 Chicago, IL'

# The parse method will split your address string into components, and label each component.
# expected output: [(u'123', 'AddressNumber'), (u'Main', 'StreetName'), (u'St.', 'StreetNamePostType'), (u'Suite', 'OccupancyType'), (u'100', 'OccupancyIdentifier'), (u'Chicago,', 'PlaceName'), (u'IL', 'StateName')]
usaddress.parse(addr)

# The tag method will try to be a little smarter
# it will merge consecutive components, strip commas, & return an address type
# expected output: (OrderedDict([('AddressNumber', u'123'), ('StreetName', u'Main'), ('StreetNamePostType', u'St.'), ('OccupancyType', u'Suite'), ('OccupancyIdentifier', u'100'), ('PlaceName', u'Chicago'), ('StateName', u'IL')]), 'Street Address')
usaddress.tag(addr)

How to use this development code (for the nerds)

usaddress uses parserator, a library for making and improving probabilistic parsers - specifically, parsers that use python-crfsuite's implementation of conditional random fields. Parserator allows you to train the usaddress parser's model (a .crfsuite settings file) on labeled training data, and provides tools for adding new labeled training data.

Building & testing the code in this repo

To build a development version of usaddress on your machine, run the following code in your command line:

git clone https://github.com/datamade/usaddress.git  
cd usaddress  
pip install -e ."[dev]"

Then run the testing suite to confirm that everything is working properly:

pytest

Having trouble building the code? Open an issue and we'd be glad to help you troubleshoot.

Adding new training data

If usaddress is consistently failing on particular address patterns, you can adjust the parser's behavior by adding new training data to the model. Follow our guide in the training directory, and be sure to make a pull request so that we can incorporate your contribution into our next release!

Team

Bad Parses / Bugs

Report issues in the issue tracker

If an address was parsed incorrectly, please let us know! You can either open an issue or (if you're adventurous) add new training data to improve the parser's model. When possible, please send over a few real-world examples of similar address patterns, along with some info about the source of the data - this will help us train the parser and improve its performance.

If something in the library is not behaving intuitively, it is a bug, and should be reported.

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Send us a pull request. Bonus points for topic branches!

Copyright (c) 2025 Atlanta Journal Constitution. Released under the MIT License.

관련 저장소
Textualize/rich

Rich is a Python library for rich text and beautiful formatting in the terminal.

PythonPyPIMIT Licensepythonpython3
rich.readthedocs.io/en/latest/
56.9k2.3k
celery/celery

Distributed Task Queue (development branch)

PythonPyPIOtherpythontask-manager
docs.celeryq.dev
28.7k5.1k
sivel/speedtest-cli

Command line interface for testing internet bandwidth using speedtest.net

PythonPyPIApache License 2.0pythonpython-library
14.1k1.9k
LonamiWebs/Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!

PythonPyPIMIT Licenselibrarytelegram
docs.telethon.dev
12.1k1.6k
kellyjonbrazil/jc

CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts.

PythonPyPIMIT Licenseparsersjson
8.6k246
pemistahl/grex

A command-line tool and Rust library with Python bindings for generating regular expressions from user-provided test cases

Rustcrates.ioApache License 2.0command-line-tooltool
pemistahl.github.io/grex-js/
8.2k196
docker/docker-py

A Python library for the Docker Engine API

PythonPyPIApache License 2.0pythondocker
docker-py.readthedocs.io
7.2k1.7k
pywinauto/pywinauto

Windows GUI Automation with Python (based on text properties)

PythonPyPIBSD 3-Clause "New" or "Revised" Licensepythonautomation
pywinauto.github.io
6.1k790
gitpython-developers/GitPython

GitPython is a python library used to interact with Git repositories.

PythonPyPIBSD 3-Clause "New" or "Revised" Licensegit-porcelaingit-plumbing
gitpython.readthedocs.org
5.1k982
MechanicalSoup/MechanicalSoup

A Python library for automating interaction with websites.

PythonPyPIMIT Licensepythonbeautifulsoup
mechanicalsoup.readthedocs.io/en/stable/
4.9k393
lukasmasuch/best-of-python

🏆 A ranked list of awesome Python open-source libraries and tools. Updated weekly.

Creative Commons Attribution Share Alike 4.0 Internationalbest-ofawesome
python.best-of.org
4.5k338
dedupeio/dedupe

:id: A python library for accurate and scalable fuzzy matching, record deduplication and entity-resolution.

PythonPyPIMIT Licensededuperecord-linkage
docs.dedupe.io
4.5k575