Skip to main content

Parse street addresses around the world

Project description

pylibpostal

Parse street addresses around the world.

This is a Python binding for libpostal, a C library for parsing/normalizing street addresses around the world using statistical NLP and open data. The goal of this project is to understand location-based strings in every language, everywhere.

Installation

You can install the latest stable version via:

$ pip install pylibpostal

Data

libpostal needs to download some data files and models from S3. The basic files are on-disk representations of the data structures necessary to perform expansion. Please refer to the documentation how to download the files.

Export the path to the data folder as environment variable:

export LIBPOSTAL_DATA_DIR="data-folder"

Usage

>>> from pylibpostal.expand import expand_address
>>> expand_address('Quatre vingt douze Ave des Champs-Élysées')
['92 avenue des champs-elysees',
 '92 avenue des champs elysees',
 '92 avenue des champselysees']
>>> from pylibpostal.parser import parse_address
>>> parse_address('The Book Club 100-106 Leonard St, Shoreditch, London,EC2A 4RH, UK')
[('the book club', 'house'),
 ('100-106', 'house_number'),
 ('leonard st', 'road'),
 ('shoreditch', 'suburb'),
 ('london', 'city'),
 ('ec2a 4rh', 'postcode'),
 ('uk', 'country')]

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 Distributions

pylibpostal-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pylibpostal-1.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

pylibpostal-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pylibpostal-1.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (2.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

Supported by

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