Skip to main content

Self-contained offline address parser powered by libpostal (global model)

Project description

address-finder

A fully self-contained Python address parser built on libpostal.

  • Zero HTTP/S3 calls at runtime
  • Global model, quantized (int8) + zstd-22 compressed
  • Works completely offline after install

Install

pip install address-finder

Usage

from address_finder import parse_address, expand_address

parse_address("781 Franklin Ave Crown Heights Brooklyn NYC NY 11216 USA")
# [('781', 'house_number'), ('franklin ave', 'road'), ...]

expand_address("Quatre vingt douze R. de la Roquette")
# ['92 rue de la roquette', ...]

Build from Source

# 1. Compile libpostal (Linux/Mac) or use WSL on Windows
bash scripts/build_libpostal.sh

# 2. Quantize model weights
python scripts/quantize_model.py --src /tmp/postal_raw --dst address_finder/_data_raw

# 3. Re-encode tries as DAWG (optional)
python scripts/build_dawg.py --datadir address_finder/_data_raw

# 4. Compress bundle
python scripts/compress_bundle.py

# 5. Build wheel
pip wheel . -w dist/

Windows

See scripts/build_windows.ps1 for step-by-step Windows build using WSL.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

address_finder-1.0.3-py3-none-win_amd64.whl (4.4 MB view details)

Uploaded Python 3Windows x86-64

File details

Details for the file address_finder-1.0.3-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for address_finder-1.0.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ca172927e9b152a6b23555a1ef289a10b6af482cfeda58cdc78ae5d0f2c40e13
MD5 26b4a28c77d97a4bf70377b3a1cfc2c5
BLAKE2b-256 928d7b6febe3002841acd6d869579c49ede809f607ca37487dc6f33503199fe9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page