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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pylibpostal-1.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6be1479f058cbb661a6fd8db39782f6f5b5d07c6e0a5a0275bdd482c791a394 |
|
MD5 | e31858903e1186b5d80ff8d3caa689fa |
|
BLAKE2b-256 | 26485ca0086d5e5e90d6b7f54a12799ff41d61fd85d8356226d57227f3aa7275 |
Hashes for pylibpostal-1.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d959f1409f8051a4e2ac5c8890a29f7275d61335b2b798094f7abb2f29a3379f |
|
MD5 | b83e3e6df7f003e800c3b36f853e12b5 |
|
BLAKE2b-256 | 4637a59cb545c0cc96d7c94749b573204342eb9ec86a37add56f24fb0e3436ad |
Hashes for pylibpostal-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf3d5eaf02d67203fe7882e19814f95e6291e9ae78982900c8223a6c37b86012 |
|
MD5 | 1baa788465b983239daefaa25be64a9b |
|
BLAKE2b-256 | 43bcd07514deff6f8f3ee3fb4e4af5ef429d4b2a6da571b330ac5f53eb498c7f |
Hashes for pylibpostal-1.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 671670801015024d3be2b9da773005be0ad50e74238b1007447fbf083b18d580 |
|
MD5 | 0d7754427f424788d04c8a5dbf5a7a6a |
|
BLAKE2b-256 | f33f151869d336a056e53e2d3dc13b2e14344f99689ceb0feb4ef931b866a2f8 |