Skip to main content

Parse, normalize and render postal addresses.

Project description

Postal Address

Python module to parse, normalize and render postal addresses.

Last release Unit-tests status Coverage Status Requirements freshness Software license Popularity

Motivation

« What ties us to territory is tax. » – Kevin Deldycke, 2014-11-07

The reason above is why we need fine-grained and meticulous territory management and normalization. This project aims to solve this problem once for all.

Don’t get me wrong, this work is a huge undertaking. Postal address parsing, normalization and rendering is hard. Much harder than you think. Please read the famous Falsehoods programmers believe about addresses pamphlet.

This library is still in its early stages, but is good enough to implement the new European Directives on VAT, which requires all e-commerce shops to guess the locality of their EU customers depending on their billing address.

Release process

Start from the develop branch:

git clone git@github.com:online-labs/postal-address.git
git checkout develop

Update revision to its release number and update change log:

vi ./postal_address/__init__.py
vi ./CHANGES.rst

Create a release commit, tag it and merge it back to master branch:

git add ./postal_address/__init__.py ./CHANGES.rst
git commit -m "Release vXX.XX.XX"
git tag "vXX.XX.XX"
git push
git push --tags
git checkout master
git pull
git merge "vXX.XX.XX"
git push

Push packaging to the test cheeseshop:

python setup.py register -r testpypi
pip install wheel
python setup.py sdist bdist_egg bdist_wheel upload -r testpypi

Publish packaging to PyPi:

python setup.py register -r pypi
python setup.py sdist bdist_egg bdist_wheel upload -r pypi

Bump revision back to its development state:

git checkout develop
vi ./postal_address/__init__.py
vi ./CHANGES.rst
git add ./postal_address/__init__.py ./CHANGES.rst
git commit -m "Post release version bump."

License

This software is licensed under the GNU General Public License v2 or later (GPLv2+).

ChangeLog

0.3.1 (2015-03-05)

  • Fix rendering of state in address.

0.3.0 (2015-03-04)

  • Remove backward compatibility with 0.1.0.

  • Allow direct import of classes from module root.

  • Split territory utils out to their own file. See #3.

  • Rename normalize_country_code to country_from_subdivision. Mark the former as deprecated.

  • Address normalization is now non-blocking. It simply reset invalid components to None. Only a call to validate method check data consistency.

0.2.1 (2014-12-22)

  • Push a new release to fix cached desynced packages on cheeseshops and clones.

0.2.0 (2014-12-18)

  • Package the whole module for proper distribution.

0.1.1 (2014-12-16)

  • Restore partial backward compatibility with address module from 0.1.0.

0.1.0 (2014-12-15)

  • First public release.

0.0.0 (2013-12-06)

  • First commit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

postal-address-0.3.1.tar.gz (22.7 kB view details)

Uploaded Source

Built Distributions

postal_address-0.3.1-py2.7.egg (18.4 kB view details)

Uploaded Source

postal_address-0.3.1-py2-none-any.whl (21.5 kB view details)

Uploaded Python 2

File details

Details for the file postal-address-0.3.1.tar.gz.

File metadata

File hashes

Hashes for postal-address-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1d9e86198d9ce5a2f60b058e8f8f1cf727090ea110f260c02f61762e2204dc02
MD5 a0b4599e10e25115fba4e8a8b56c6b16
BLAKE2b-256 be03cdd4146735e45d75e35129b599f8946059bf9e1899fc94e9737e71ba524f

See more details on using hashes here.

File details

Details for the file postal_address-0.3.1-py2.7.egg.

File metadata

File hashes

Hashes for postal_address-0.3.1-py2.7.egg
Algorithm Hash digest
SHA256 08217e086b84a934a8bcddd310740cdb63766c6b453f760e6df496e83049c71b
MD5 911588b572989f7de9281dff2eda6590
BLAKE2b-256 a584d06eec1f3795bd7b402e961a9da9d207b6663b42f803ae5315a998b15b12

See more details on using hashes here.

File details

Details for the file postal_address-0.3.1-py2-none-any.whl.

File metadata

File hashes

Hashes for postal_address-0.3.1-py2-none-any.whl
Algorithm Hash digest
SHA256 d3663c51e3b059d0509f5da81c305371eca823f0bcb89471b997d8d4933c1fe0
MD5 1cce23f1a036820ca1546f1394fdfd1c
BLAKE2b-256 18fef9e281b6c5bb7bd92a09cbf9cd0eb47f9da2037f3800691a511595904b77

See more details on using hashes here.

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