A demo app for parsing addresses. Given a street address like "Alexanderplatz 75" will return the
dictionary {"street": "Alexanderplatz", "housenumber": 75}
.
- Python 3.8+
- libpostal
- postal - Python bindings for libpostal
- Django
- Django Rest Framework
- gunicorn
- Docker
- Pytest
- Pytest-Django
Clone this repository onto your computer and run the following commands to build and start the application.
git clone https://github.com/abrahamy/hello-app.git
cd hello-app
docker build -t helloapp .
docker run --rm -p8000:8000 helloapp
The application is now running on localhost at port 8000.
Run unit tests with this command docker run --rm helloapp pytest
Launch the python interactive shell by running docker run -it --rm helloapp python
. The parser can be called as shown below.
Note: To run on your computer without using docker you need to ensure that the above dependencies are install. You may need to
add export LD_LIBRARY_PATH=/usr/local/lib
in your .zshrc
or .bashrc
. Alternatively, you may prefix your commands like
so LD_LIBRARY_PATH=/usr/local/lib python
.