pypostal
1.0
이것들은 전 세계 어디에서나 거리 주소를위한 빠른 통계 파서/정상화 인 https://github.com/openvenues/libpostal에 대한 공식적인 파이썬 바인딩입니다.
from postal . expand import expand_address
expand_address ( 'Quatre vingt 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' )파이썬 바인딩을 사용하기 전에 LibPostal C 라이브러리를 설치해야합니다. 다음과 같은 전제 조건이 있는지 확인하십시오.
우분투/데비안에서
sudo apt-get install curl autoconf automake libtool python-dev pkg-config
Centos/Rhel에서
sudo yum install curl autoconf automake libtool python-devel pkgconfig
Mac OSX에서
brew install curl autoconf automake libtool pkg-config
libpostal 설치
git clone https://github.com/openvenues/libpostal
cd libpostal
./bootstrap.sh
./configure --datadir=[...some dir with a few GB of space...]
make
sudo make install
# On Linux it's probably a good idea to run
sudo ldconfig
파이썬 라이브러리를 설치하려면 다음을 실행하십시오.
pip install postal
Pypostal은 Python 2.7+ 및 Python 3.4+를 지원합니다. 이러한 바인딩은 Python C API를 사용하여 작성되므로 CPYTHON 만 지원합니다. Libpostal은 독립형 C 라이브러리이므로 CFFI 래퍼를 사용하면 여전히 PYPY 지원이 가능하지만이 repo의 목표는 아닙니다.
코를 설치 한 다음 실행하십시오.
python setup.py build_ext --inplace
nosetests postal/tests
build_ext --inplace 비즈니스가 필요하므로 C 확장자가 소스 체크 아웃 디렉토리에 빌드하고 Python 모듈에 의해 액세스 가능/importalbe가 필요합니다.