Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An SQL-backed store for the Annotator using Flask [flask.pocoo.org]

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 annotator
Octocat-spinner-32 db
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 annotator.cfg.example
Octocat-spinner-32 consumer.py
Octocat-spinner-32 requirements
Octocat-spinner-32 run.py
README.md

Annotator Store

This is a backend store for the Annotator.

Getting going

You'll need a recent version of python (>=2.6). This code relies on the flask and elixir libraries.

The quickest way to get going assumes you have the pip and virtualenv tools installed (protip: easy_install virtualenv will get them both). Run the following in the repository root:

pip -E pyenv install -r requirements
source pyenv/bin/activate
cp annotator.cfg.example annotator.cfg
python run.py

You should see something like:

* Running on http://127.0.0.1:5000/
* Restarting with reloader...

The annotation store, a JSON-speaking REST API, will be mounted at http://localhost:5000/store/annotations. You can test this by running:

$ curl -i http://localhost:5000/store/annotations
HTTP/1.0 200 OK
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Location
Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Access-Control-Max-Age: 86400
Content-Length: 2
Server: Werkzeug/0.6.2 Python/2.6.1
Date: Fri, 10 Dec 2010 11:44:33 GMT

[]

The "[]" at the end indicates the empty list for your annotations. There are no annotations currently in the store. See the Annotator repository for details on getting an annotator talking to this backend.

Running tests

Running pip -E pyenv install -r requirements or similar, as described above, should have installed nose for you. In the virtualenv, you should be able to run the tests as follows:

$ nosetests
.....................
----------------------------------------------------------------------
Ran 21 tests in 0.502s

OK

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.

Something went wrong with that request. Please try again.