pyap2
Pyap2 is a maintained fork of pyap, a regex-based library for parsing US, CA, and UK addresses. The fork adds typing support, handles more address formats and edge cases.
Decision gist · record as of 2026-08-14
Yes, if you need lightweight regex-based address detection in US, Canadian, or British text and can tolerate occasional false positives. The low install friction, active maintenance, MIT license, and zero security vulnerabilities make it a safe choice. Not suitable if you require high accuracy on non-English addresses or need validation against authoritative address databases.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later (supports 3.9, 3.10, 3.11).
- Low install friction with no runtime dependencies.
- Actively maintained as of 2026-07-10 with recent releases; repository shows minimal activity (4 stars) but is not archived.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you must retain the license notice in distributions.
last release 2026-07-10 (35 days) · last repo commit 2026-07-10 · 4 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 245,531 downloads/mo, #8,729 on PyPI
Alternatives
Verify before relying
pip install pyap2
import pyap
test_address = "225 E. John Carpenter Freeway, Suite 1500 Irving, Texas 75062"
addresses = pyap.parse(test_address, country='US')
for address in addresses:
print(address.as_dict())- Whether the library's regex-based approach performs adequately on your specific address formats and edge cases beyond the documented US, Canadian, and British support.
- Performance characteristics when parsing large volumes of text or addresses.
What it is and what it does
Pyap2 is a maintained fork of the original Pyap library that uses regular expressions to find and parse postal addresses embedded in unstructured text. It extracts address components (street, city, state, zip) and returns them as structured objects or dictionaries. The library is designed for quick detection when you don't know whether text contains addresses at all, making it useful in web scraping and data extraction workflows.
Because it relies on regex patterns rather than city lists or street databases, it's fast but can produce false positives on strings that happen to match address-like patterns. The maintainers note that such errors are rare in practice. The fork adds type hints and handles more edge cases than the original, including partial addresses with only street information.
Use it for
- Extract shipping or mailing addresses from user-submitted forms or scraped web content.
- Parse addresses from unstructured documents like emails or PDFs before geocoding or validation.
- Detect whether a text block contains an address as a preprocessing step in data pipelines.
- Normalize address components (street, city, state, zip) into structured fields for database storage.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need lightweight regex-based address detection in US, Canadian, or British text and can tolerate occasional false positives.
The low install friction, active maintenance, MIT license, and zero security vulnerabilities make it a safe choice. Not suitable if you require high accuracy on non-English addresses or need validation against authoritative address databases.
Install
pyap2 on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as of 2026-07-10 with recent releases; repository shows minimal activity (4 stars) but is not archived.
Requires Python 3.9 or later (supports 3.9, 3.10, 3.11).
License in practice
MIT license permits commercial and private use with minimal restrictions; you must retain the license notice in distributions.
Quickstart
pip install pyap2
import pyap
test_address = "225 E. John Carpenter Freeway, Suite 1500 Irving, Texas 75062"
addresses = pyap.parse(test_address, country='US')
for address in addresses:
print(address.as_dict())
Verify before relying
- Whether the library's regex-based approach performs adequately on your specific address formats and edge cases beyond the documented US, Canadian, and British support.
- Performance characteristics when parsing large volumes of text or addresses.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 35 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 245,531 / month, #8,729 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Information AnalysisTopic :: Software Development :: LibrariesTopic :: Utilities |
Evidence: pyap2-0.2.17-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “address parser regex”
- pyap2Pyap2 detects and parses postal addresses from unstructured text…
- pyapPyap detects and parses postal addresses from unstructured text,…
- postalPython bindings to libpostal, a C library for parsing and normalizing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also postal · pyap · usaddress · usaddress-scourgify · pypostalcode · geotext · commonregex · lob · mailbits · google-i18n-address