Skip to main content

doorplate

CI PyPI Python versions PyPI downloads License: MIT OR Apache-2.0

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.

Alpha release (0.4.1). Expect rough edges. The match key is versioned (k3:) and will probably get new versions as the parser improves, so store the version prefix with your keys and plan to re-key. k3 is new in 0.4.0 and has only been checked on the project's own test data, so a k4 may follow soon. Accuracy and speed are measurements on a few datasets, not guarantees.

Help wanted: messy addresses. If it parses your addresses badly, 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          # "MAIN"
a.unit_number          # "4"
a.place                # {"name": "MIAMI", "state": "FL", "county": "DADE", ...}
a.warnings             # []
a.to_usps()["line1"]   # "123 N MAIN ST APT 4"
a.to_display()["line1"]  # "123 N Main St Apt 4" (to_long(): "123 North Main Street Apartment 4"); display only, not Pub 28
a.key()                # "k3:S|123|N|MAIN|ST||FL|33101"
a.slug()               # "123-n-main-st-apt-4-miami-fl-33101"
a.to_reso()            # RESO Data Dictionary 2.0 fields
a.to_dict()            # everything above as plain Python values, and provenance (the library version and the state data version; also `a.library_version`, `a.state_data_version`)

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_fields_many(line1=["1 Main St", "PO Box 5"], city=["Miami", "Tampa"])
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

The API

The calls are parse, parse_fields, parse_many, parse_fields_many, Parser, tag, parse_tokens, load_layer, Anonymizer and address_type; a ParsedAddress is read-only and typed (py.typed), with the components, warnings, unparsed, and key(), slug(), to_usps(), to_display(), to_reso() and to_dict(). The tour is the Python guide; every function and class is in the Python reference.

Your data, by shape

A column of addresses in pandas, Polars or DuckDB, split columns, mixed shapes, a CSV file: see pandas, Polars and DuckDB (one call per shape, with timings), or the examples in the repository.

Batches, pandas, Polars and DuckDB

parse_many(texts) parses a list on every core with the GIL released (about 3x a loop of parse), and the helpers doorplate.pandas.parse_column, doorplate.polars.parse_column and doorplate.duckdb build on it:

from doorplate.polars import parse_column   # or doorplate.pandas

out = df.hstack(parse_column(df["address"]))                    # Polars
out = df.join(parse_column(df["address"], default_state="FL"))  # pandas

The columns, DuckDB in SQL, doing it by hand and the timings are in pandas, Polars and DuckDB.

Custom layers

Your data spells TRAIL as TRAYL, or lives in a place the shipped list lacks? doorplate.load_layer("DIR") adds your own spellings, words, places and ZIPs on top of the shipped tables (custom_layer= on every call). A layer can change a key, so every parse reports it. The files, the rules, a demo layer, a template and a prompt for an LLM are in Custom layers.

Sharing messy data

doorplate.Anonymizer(seed=None).anonymize("123 N Zephyrmill Ave Apt 4, Miami, FL 33101") gives a copy that keeps the shape and loses the names and numbers, even when the text does not parse. It is obfuscation, not anonymity: read the output before you share it. The rules, the limits and what it can leak are in Anonymizing data.

Coming from usaddress

For a script that calls usaddress.parse and usaddress.tag, change one import (label compatibility, not identical output):

import doorplate.compat as usaddress    # was: import usaddress

The same calls under doorplate's own names are parse_tokens(s) and tag(s). The mapping and the differences are in Coming from usaddress.

Accuracy and speed

doorplate usaddress
Whole address right, benchmark suite, natural stratum (16,001 addresses written in five styles) 98.3% 96.1%
Whole address right, geocode benchmark dev split (60,522 one-line addresses) 94.5% 88.1%
Addresses per second, one thread (suite inputs) about 38,300 about 8,900

The suite is 19,586 labeled addresses that neither library was made from; it also holds both libraries' known blind spots on purpose, so read its natural stratum as the estimate for ordinary input. Speed is on 4 CPUs, 8 GB. These are measurements on a few data sets, not promises for yours. Method and every other figure: accuracy and speed and size; how to rerun them: running the benchmarks.

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.

Metadata

Release files for doorplate 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doorplate 0.4.1
File Size Uploaded Provenance Actions
doorplate-0.4.1.tar.gz 933.5 kB With provenance Details for doorplate-0.4.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for doorplate 0.4.1
File Actions
doorplate-0.4.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for doorplate-0.4.1-cp310-abi3-win_amd64.whl
doorplate-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for doorplate-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
doorplate-0.4.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for doorplate-0.4.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
doorplate-0.4.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.10 abi3 macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) Details for doorplate-0.4.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Total release size: 11.1 MB

Release files / doorplate-0.4.1.tar.gz

Download URL doorplate-0.4.1.tar.gz
Size 933.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7927195a26deceb7a4941aedc59c09eba6f88a1b9276b5d8f48b50a7f8c64aa2
BLAKE2b-256 checksum
How to use checksums
1ae2670644af84a80ea584261ecd003fd83eaf7f58de5acf4c299dd2f1352b25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / doorplate-0.4.1-cp310-abi3-win_amd64.whl

Download URL doorplate-0.4.1-cp310-abi3-win_amd64.whl
Size 2.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f84b5d44f4f6e7937c00c4b57559621c99df299d5ba0e29499abff2a840b6a5a
BLAKE2b-256 checksum
How to use checksums
518f4ea6c09ca80b59068f531d13d2add577cc194d99d7de841f4d8632a6425e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / doorplate-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL doorplate-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
468f03598e97a22c4abbbeb4d0e2b36313e94e4ed18ec587cbec34b111eb6535
BLAKE2b-256 checksum
How to use checksums
fe62ea069191e7e7b551b5b79f1b58cca6f629690ae63a553171d4b6d325a573
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / doorplate-0.4.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL doorplate-0.4.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
c7a13b9f9c26bd0f740a83bbbf5e4c3b6d1e2ebb2fe659a3169df57e6120534b
BLAKE2b-256 checksum
How to use checksums
0548cd585625964f3a09facb37c76ed7181bc5deb95f96cbbc90ae673612e759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / doorplate-0.4.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL doorplate-0.4.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 4.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bf45a3732d9937aba64369c22be14d755cfffc8948c08ffdeb69183d0901c6d1
BLAKE2b-256 checksum
How to use checksums
1d0c4848a30e7354213de3548fee066e17fb27741259d8be1ace0a337ad942ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for doorplate 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for doorplate-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page