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.2-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.2-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for address_finder-1.0.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 108c99798158a65b5de14be7d19004f71a54ef8e7b07c9c3fc8558585082c522
MD5 7d2accbf66b8197699d86aacfa13c3e0
BLAKE2b-256 3b5bd8c598a86a68014900e611fa3c84726dc001f40dadd0aade2e8d50f53f39

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