Python bindings to libpostal for fast international address parsing/normalization
C Python
Pull request Compare This branch is 12 commits behind openvenues:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Build Status

These are the official Python bindings to, a fast statistical parser/normalizer for street addresses anywhere in the world.


from postal.expand import expand_address
expand_address('Quatre vignt douze Ave des Champs-Élysées')

from postal.parser import parse_address
parse_address('The Book Club 100-106 Leonard St, Shoreditch, London, Greater London, EC2A 4RH, United Kingdom')


Before using the Python bindings, you must install the libpostal C library. Make sure you have the following prerequisites:

On Linux (Ubuntu)

sudo apt-get install libsnappy-dev autoconf automake libtool python-dev pkg-config

On Mac OSX

sudo brew install snappy autoconf automake libtool pkg-config

Installing libpostal

git clone
cd libpostal
./configure --datadir=[...some dir with a few GB of space...]
sudo make install

# On Linux it's probably a good idea to run
sudo ldconfig

To install the Python library, just run:

git clone
cd pypostal
python install

If you want to import or run tests straight from your source checkout, use:

python build_ext --inplace


pypostal supports Python 2.7+ and Python 3.4+. These bindings are written using the Python C API and thus support CPython only. Since libpostal is a standalone C library, support for PyPy is still possible with a ctypes or CFFI wrapper, but is not a goal for this repo.


Make sure you have nose installed, then run:

nosetests postal/tests