Name: address-search-api
Owner: HM Land Registry
Description: null
Created: 2015-08-27 09:56:55.0
Updated: 2016-03-04 13:41:52.0
Pushed: 2016-06-21 15:20:32.0
Homepage: null
Size: 14013
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is the repo for the Address Search API service. It is written in Python, with the Flask framework.
To create a virtual env, run the following from a shell:
mkvirtualenv -p /usr/bin/python3 address-search-api
pip install -r requirements.txt
pip install -r requirements_test.txt
To import data, run the following from a shell:
workon address-search-api
source environment.sh
python3 import.py /path/to/top_level_directory
The data needs to be in a folder inside another folder (see Example AddressBase directory)
This is to emulate the FTP server structure where we receive the data from Ordnance Survey
Purely for local testing you can use :
python3 import.py 'Example AddressBase directory'
During development it's occasionally useful to delete the elasticsearch index. To do so, use this command:
curl -XDELETE $ELASTIC_SEARCH_ENDPOINT/address-search-api-index
To run the server in dev mode, execute the following command:
./run_flask_dev.sh
To run the server using gunicorn, activate your virtual environment and execute the following commands:
pip install gunicorn
gunicorn -p /tmp/gunicorn.pid service.server:app -c gunicorn_settings.py
To run unit tests, cd into the address-search-api directory and run lr-run-unit-tests
.