{"id":13466884,"url":"https://github.com/openvenues/pypostal","last_synced_at":"2025-05-14T04:10:17.285Z","repository":{"id":44139373,"uuid":"50410511","full_name":"openvenues/pypostal","owner":"openvenues","description":"Python bindings to libpostal for fast international address parsing/normalization","archived":false,"fork":false,"pushed_at":"2025-02-10T04:40:22.000Z","size":69,"stargazers_count":810,"open_issues_count":40,"forks_count":94,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-14T00:42:33.872Z","etag":null,"topics":["address","address-parser","binding","international","nlp"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openvenues.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-26T07:07:50.000Z","updated_at":"2025-05-13T09:23:51.000Z","dependencies_parsed_at":"2024-06-18T15:32:00.534Z","dependency_job_id":"062a0a85-0db1-4212-a974-296039c2dc93","html_url":"https://github.com/openvenues/pypostal","commit_stats":{"total_commits":84,"total_committers":6,"mean_commits":14.0,"dds":0.0714285714285714,"last_synced_commit":"427f0a78115822596f010efe2e33855f6135c5f4"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fpypostal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fpypostal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fpypostal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvenues%2Fpypostal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openvenues","download_url":"https://codeload.github.com/openvenues/pypostal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254070112,"owners_count":22009559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["address","address-parser","binding","international","nlp"],"created_at":"2024-07-31T15:00:51.025Z","updated_at":"2025-05-14T04:10:12.266Z","avatar_url":"https://github.com/openvenues.png","language":"C","funding_links":[],"categories":["C","Geospatial Library","Python"],"sub_categories":["Python"],"readme":"pypostal\n--------\n\n[![Build Status](https://travis-ci.org/openvenues/pypostal.svg?branch=master)](https://travis-ci.org/openvenues/pypostal) [![PyPI version](https://img.shields.io/pypi/v/postal.svg)](https://pypi.python.org/pypi/postal) [![License](https://img.shields.io/github/license/openvenues/pypostal.svg)](https://github.com/openvenues/pypostal/blob/master/LICENSE)\n\nThese are the official Python bindings to https://github.com/openvenues/libpostal, a fast statistical parser/normalizer for street addresses anywhere in the world.\n\nUsage\n-----\n\n```python\nfrom postal.expand import expand_address\nexpand_address('Quatre vingt douze Ave des Champs-Élysées')\n\nfrom postal.parser import parse_address\nparse_address('The Book Club 100-106 Leonard St, Shoreditch, London, Greater London, EC2A 4RH, United Kingdom')\n```\n\nInstallation\n------------\n\nBefore using the Python bindings, you must install the libpostal C library. Make sure you have the following prerequisites:\n\n**On Ubuntu/Debian**\n```\nsudo apt-get install curl autoconf automake libtool python-dev pkg-config\n```\n**On CentOS/RHEL**\n```\nsudo yum install curl autoconf automake libtool python-devel pkgconfig\n```\n**On Mac OSX**\n```\nbrew install curl autoconf automake libtool pkg-config\n```\n\n**Installing libpostal**\n\nIf you're using an M1 Mac, add --disable-sse2 to the ./configure command. This will result in poorer performance but the build will succeed.\n\n```\ngit clone https://github.com/openvenues/libpostal\ncd libpostal\n./bootstrap.sh\n./configure --datadir=[...some dir with a few GB of space...]\nmake\nsudo make install\n\n# On Linux it's probably a good idea to run\nsudo ldconfig\n```\n\nTo install the Python library, just run:\n\n```\npip install postal\n```\n\n**Installing libpostal on Windows**\n\nInstall [msys2](http://msys2.org) and launch a shell using the `MSYS2 MingW 64-bit` start menu option, **not** the usual `MSYS2 MSYS` option.\nThis is important because we don't want our `libpostal.dll` to [link to](https://www.davidegrayson.com/windev/msys2/) `msys-2.0.dll` (Python seems to hang if you load this DLL).\n\nThen:\n```\npacman -S autoconf automake curl git make libtool gcc mingw-w64-x86_64-gcc\ngit clone https://github.com/openvenues/libpostal\ncd libpostal\ncp -rf windows/* ./\n./bootstrap.sh\n./configure --datadir=[...some dir with a few GB of space...]\nmake\nmake install\nmkdir headers \u0026\u0026 cp -r /usr/include/libpostal/ headers/\n```\n\nNow start a command prompt which has access to the Microsoft toolchain. This can be done by e.g. installing the [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) and then running the ``x64 Native Tools Command Prompt``.\n\nAssuming your MSYS and Python are installed in some standard locations, you can use this command prompt to build+install the Python library like so:\n```\nlib.exe /def:libpostal.def /out:postal.lib /machine:x64\npip install postal --global-option=build_ext --global-option=\"-I[...libpostal checkout...]\\headers\" --global-option=\"-L[...libpostal checkout...]\"\ncopy src\\.libs\\libpostal-1.dll \"C:\\Python36\\Lib\\site-packages\\postal\\libpostal.dll\"\n```\n\nCompatibility\n-------------\n\npypostal 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 CFFI wrapper, but is not a goal for this repo.\n\nTests\n-----\n\nMake sure you have [nose](https://nose.readthedocs.org/en/latest/) installed, then run:\n\n```\npython setup.py build_ext --inplace\nnosetests postal/tests\n```\n\nThe ```build_ext --inplace``` business is needed so the C extensions build in the source checkout directory and are accessible/importable by the Python modules.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvenues%2Fpypostal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenvenues%2Fpypostal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvenues%2Fpypostal/lists"}