doorplate

Parse US addresses into components, with USPS Publication 28 and RESO output, a
match key, a URL-safe slug, and diagnostics. A Rust library with Python bindings
(PyO3, abi3 wheels for Python 3.10 and later); no runtime dependencies and no data
to download.
This library formats and parses; it does not validate that an address exists or
can receive mail.
Beta release (0.7.2). The API, the command-line options and the warning codes are stable: a name changes only after a deprecation. The match key may still get a new version in a minor release.
The match key is versioned (k6:) and later versions will probably change it, so store
the prefix with your keys and plan to re-key. k6 has only been checked on the project's own data (public records). Accuracy and speed are measurements on a few datasets, not guarantees.
Help wanted: messy addresses. If it parses your addresses badly (odd abbreviations, typos, cut-off lines, units in
strange places, county or mailing-list exports), please
open an issue
with a sample. I want to fix them. Private data can be anonymized first
(how).
Quickstart
pip install doorplate
import doorplate as dp
a = dp.parse("123 north main street apt 4, Miami FL 33101")
a.street_name, a.unit_number # ("MAIN", "4")
a.to_usps()["line1"] # "123 N MAIN ST APT 4"
a.key() # "k6:S|123|N|MAIN|ST||FL|33101"
a.slug() # "123-n-main-st-apt-4-miami-fl-33101"
a.warnings # []
dp.parse_fields(line1="THE COVE", line2="1111 ASBURY WAY", city="Orlando", state="FL", zip="32801")
dp.parse_many(["1 Main St, Miami FL", "PO Box 5, Tampa FL"]) # GIL released
dp.parse("281 EVELYN DR DOTHAN", default_state="AL").city # "DOTHAN"
- Unusable input (no address text at all) raises
ParseError, a ValueError; in
parse_many that element is None. Anything else comes back with warnings (what each one tells you, and how often it is wrong).
default_state is a lookup hint for input with no state; it never fills state.
A value that is not a US state, DC or territory raises ValueError.
Install
pip install doorplate # the parser
pip install "doorplate[pandas]" # plus the pandas helper
pip install "doorplate[polars]" # plus the Polars helper
pip install "doorplate[duckdb]" # plus the DuckDB functions (DuckDB and PyArrow)
Python 3.10 or later. Wheels are built for Linux (x86_64, aarch64), macOS
(universal2) and Windows (x64), and tested on Python 3.10 and 3.13. To build from
source (Rust 1.83 or later):
pip install maturin
cd crates/doorplate-py
maturin develop --release # builds the extension into your virtualenv
pytest tests
Guides
- Python guide (the tour) and Python reference (every function and class).
- pandas, Polars and DuckDB: a column, split fields, a table or a CSV file, one call per shape.
parse_many uses every core with the GIL released.
- Custom layers:
doorplate.load_layer("DIR") adds your own spellings, words, places and ZIPs; a layer can change a key, so every parse reports it.
- Anonymizing data:
doorplate.Anonymizer keeps the shape and loses names and numbers. Obfuscation, not anonymity: read the output before you share it.
- Coming from usaddress:
import doorplate.compat as usaddress (label compatibility, not identical output).
Accuracy and speed
|
doorplate |
usaddress |
libpostal |
| Parser Score, parser showdown (hand-labeled golden set and four outside sets; doorplate 0.7.1) |
91.8 |
84.7 |
80.8 |
| Whole address right, showdown random public stratum (829 real address lines) |
93.7% |
93.0% |
91.3% |
Whole address right, benchmark suite, natural stratum (16,001 addresses in five styles) |
98.6% |
96.5% |
95.0% |
Whole address right, geocode benchmark dev split (60,522 one-line addresses) |
94.4% |
88.4% |
79.9% |
| Strings per second from Python, one process |
about 117,000 |
about 9,000 |
about 15,600 |
| Memory after loading |
25 MB |
27 MB |
about 3 GB |
Every row is from the showdown's pinned run of 2026-11-23: the published doorplate 0.7.1 (it parses exactly as 0.7.0),
usaddress 0.5.16 and libpostal (Senzing model), at default settings on 4 CPUs. The geocode benchmark is Yin, Li and Goldberg,
arXiv:2310.14360. doorplate's author built the showdown: the method, the conflict of interest and
every prediction file are in its report. These are measurements on a few data sets, not
promises for yours. doorplate's own benchmark suite, the other checks and the speed figures by build:
benchmarks and speed, size and memory.
Disclaimer
doorplate is provided "as is", without warranty of any kind, under the MIT or
Apache-2.0 license at your option; the license text is what governs. In plain
terms: use it at your own risk. Nothing here guarantees that a parse, a warning, a match key
or a figure is correct, complete or fit for your purpose. Accuracy and speed numbers are
measurements on particular datasets, not promises for yours. doorplate parses and formats
addresses; it does not validate that an address exists or can receive mail, and Pub 28
formatting is not certified validation. Check its output before you rely on it for anything with
legal, financial, safety or delivery consequences.
doorplate is an independent project. It is not affiliated with, endorsed by or certified by the
US Postal Service, RESO, DataMade (the authors of usaddress) or any data source it cites; those
names are used only to say what the output follows or is compared with.
More
Licensed under either of MIT or Apache-2.0 at your option.