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

File metadata

File hashes

Hashes for address_finder-1.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a037d3cf8573376a503e09d4b581dfd94f0556cfc597074f825aa8092452163c
MD5 494066e34f39d6dd6657bb1318509d8d
BLAKE2b-256 18543f859a774f5f92bc82f6dd534ac00dd660a3fd5a1749416f74914af35d4f

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