pyap
Pyap is an MIT Licensed text processing library, written in Python, for detecting and parsing addresses. Currently it supports USA, Canadian and British addresses.
What it is and what it does
Pyap is a lightweight text-processing library that finds and extracts postal addresses from unstructured text using regular expressions. It targets US, Canadian, and British address formats, breaking them into structured components (street, city, state, postal code) that you can access programmatically.
The library trades accuracy for speed: it uses pattern matching rather than gazetteers or machine learning, so it can process large volumes of text quickly in real time. This makes it useful for initial address detection in web scraping or bulk text processing, though the description notes that false positives can occur when text happens to match the address pattern structure. The project is dormant but has no runtime dependencies, making it lightweight to deploy.
Use it for:
- Extract addresses from web-scraped content or document text during initial data collection before validation
- Batch-process large volumes of unstructured text to identify and isolate address-like patterns quickly
- Pre-filter text for geocoding services to reduce the volume of strings sent to paid APIs
- Parse addresses embedded in email bodies, PDFs, or other documents for contact database population
- Detect mailing addresses in user-submitted forms or comments for location-based features
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pyap detects and parses postal addresses from unstructured text, extracting structured address components for US, Canadian, and British addresses using pattern matching.
Yes, if you need fast regex-based address detection for US, Canadian, or British addresses in bulk text processing and can tolerate occasional false positives. No, if you require high accuracy, active maintenance, or support for additional countries—consider a geocoding service or maintained alternative instead. The lack of dependencies and dormant status make it a low-risk, lightweight choice for specific use cases.
Install
pyap on PyPI
pip
pip install pyapuv
uv add pyappoetry
poetry add pyapInstalling pyap
Before you install
Installation is straightforward with no runtime dependencies. The project is dormant (last commit 2023-12-13, latest release 2020-09-30), so expect no active maintenance or bug fixes, though the codebase remains available and archived.
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include the license notice in distributions.
Quickstart
pip install pyap
import pyap
text = "225 E. John Carpenter Freeway, Suite 1500 Irving, Texas 75062"
addresses = pyap.parse(text, country='US')
for addr in addresses:
print(addr.as_dict())
Verify before relying
- Whether false-positive rate remains acceptable for production use cases beyond the 'quite rare' claim in the description
- Current compatibility with modern Python versions beyond the declared support range
- Whether regex patterns have been updated to handle modern address formats or postal code standards
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 2,144 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 460,845/month — #6,537 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyap-0.3.1-py2.py3-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
pyap2Pyap2 detects and parses postal addresses from…
permissive · top 15,000 on PyPI
postalPython bindings to libpostal, a C library for…
permissive · top 15,000 on PyPI
usaddressusaddress parses unstructured US address…
permissive · top 5,000 on PyPI
usaddress-scourgifyCleans and normalizes US addresses to USPS and…
unclear · top 5,000 on PyPI
lobPython wrapper for the Lob.com API, providing…
permissive · top 15,000 on PyPI
pypostalcodeLooks up Canadian postal codes to retrieve…
permissive · top 15,000 on PyPI
xknxprojectExtracts and parses KNX project files (ETS 4,…
copyleft · top 15,000 on PyPI
mailbitsProvides utilities for parsing, converting, and…
permissive · top 15,000 on PyPI
geotextGeotext extracts mentions of countries and…
permissive · top 15,000 on PyPI
google-i18n-addressValidates, normalizes, and formats postal…
permissive · top 15,000 on PyPI