Parse US addresses using conditional random fields
pip install usaddressusaddress
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
- Install usaddress with pip, a tool for installing and managing python packages (beginner's guide here).
In the terminal,
pip install usaddress
- Parse some addresses!

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)