annotator_store is a Django application meant for use within a Django project as an annotator.js 2.x annotation store backend, and implements the Annotator Storage API.
annotator_store was originally develop as a component of Readux.
License
This software is distributed under the Apache 2.0 License.
Installation
Use pip to install:
pip install
You can also install from GitHub. Use branch or tag name, e.g. @develop or @1.0, to install a specific tagged release or branch:
pip install git+https://github.com/Princeton-CDH/django-annotator-store.git@develop#egg=annotator_store
Configuration
Add annotator_store to installed applications and make sure that other required components are enabled:
INSTALLED_APPS = (
...
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'annotator_store',
...
)
Include the annotation storage API urls at the desired base url with the namespace:
from annotator_store import views as annotator_views
urlpatterns = [
# annotations
url(r'^annotations/api/', include('annotator_store.urls', namespace='annotation-api')),
# annotatorjs doesn't handle trailing slash in api prefix url
url(r'^annotations/api', annotator_views.AnnotationIndex.as_view(), name='annotation-api-prefix'),
]
Run migrations to create annotation database tables:
python manage.py migrate
Custom Annotation Model
This module is designed to allow the use of a custom Annotation model, in order to add functionality or relationships to other models within an application. To take advantage of this feature, you should extend the abstract model annotator_store.models.BaseAnnotation and configure your model in Django setings, e.g.:
ANNOTATOR_ANNOTATION_MODEL = 'myapp.LocalAnnotation'
If you want per-object permissions on your annotation model, you should extend annotator_store.models.AnnotationWithPermissions rather than the base annotation class.
Development instructions
This git repository uses git flow branching conventions.
Initial setup and installation:
recommended: create and activate a python virtualenv:
virtualenv annotator-store source annotator-store/bin/activate
pip install the package with its python dependencies:
pip install -e .
Unit Testing
Unit tests are run with py.test but use Django test classes for convenience and compatibility with django test suites. Running the tests requires a minimal settings file for Django required configurations.
Copy sample test settings and add a SECRET_KEY:
cp ci/testsettings.py testsettings.py
To run the tests, either use the configured setup.py test command:
python setup.py test
Or install test requirements and use py.test directly:
pip install -e '.[test]' py.test
Sphinx Documentation
To work with the sphinx documentation, install sphinx directly via pip or via:
pip install -e '.[docs]'
Documentation can be built in the docs directory using:
make html
Metadata
Release files for annotator_store 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| annotator_store-0.6.0.tar.gz | 790.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| annotator_store-0.6.0-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 1.6 MB
Release files / annotator_store-0.6.0.tar.gz
| Download URL | annotator_store-0.6.0.tar.gz |
|---|---|
| Size | 790.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bc65e8be3e6816ec7743d1d3819be5b5c9da7e7369fa57b19ce58e5b6f3ce89
|
|
BLAKE2b-256 checksum How to use checksums |
b17e38d233307dc8ece0b91aeea54004070e91cfe974c2e36c69525f80f3b3e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / annotator_store-0.6.0-py2-none-any.whl
| Download URL | annotator_store-0.6.0-py2-none-any.whl |
|---|---|
| Size | 798.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
07809d58679924bae3f2096de9719e5b4594c9c58cfab639959d80098383d67b
|
|
BLAKE2b-256 checksum How to use checksums |
d2c751a49633048c98920db8d8a40522d1a0d596256633b9b44433574a9193b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |