The functionality can roughly be separated in the follow parts:
- A Flask blueprint for a web server that exposes an HTTP API to the annotation storage.
- An web application which enables the logged user to insert, delete and reply annotations of descriptions.
You'll need a recent version of Python (Python 2 >=2.6 or Python 3 >=3.9) and ElasticSearch (=1.7.6) installed.
To create and run a image of Elasticsearch:
docker-compose upThe quickest way to get going requires the pipenv
tools and (pipenv install will get all). Run the
following in the repository root:
pipenv shell
pipenv install
python run.pyYou should see something like:
* Running on http://localhost:5000/
* Restarting with reloader...Additionally, the HOST and PORT environment variables override
the default socket binding of address 127.0.0.1 and port 5000.
The Store API is designed to be compatible with the
Annotator. The annotation store, a
JSON-speaking REST API, will be mounted at /api by default. See the
Annotator
documentation for
details.
The API access point can be found in: <http://localhost:5000/docs>
The website app allow to annotate website descriptions.
We use nosetests to run tests. You can just
pip install -e .[testing], ensure ElasticSearch is running, and
then:
$ nosetests Ran 86 tests in 19.171s OK
Alternatively (and preferably), you should install
Tox, and then run tox. This will run
the tests against multiple versions of Python (if you have them
installed).
Please open an issue
if you find that the tests don't all pass on your machine, making sure to include
the output of pip freeze.