Django app for IIIF Presentation book content
Project description
Django application to index and display IIIF Manifests for books
djiffy is intended to be a reusable Django application for working with digitized book content provided via IIIF Presentation manifests. This is an alpha version and it does not yet support the full IIIF Presentation specification.
Installation
Use pip to install:
pip install djiffy
You can also install from GitHub. Use a 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/djiffy.git@develop#egg=djiffy
Configuration
Add djiffy to installed applications and make sure that django.contrib.humanize is also enabled:
INSTALLED_APPS = ( ... 'django.contrib.humanize', 'dal', 'dal_select2', 'djiffy', ... )
Include the default djiffy urls at the desired base url with the namespace djiffy:
urlpatterns = [ ... url(r'^iiif-books/', include('djiffy.urls', namespace='djiffy')), ... ]
Run migrations to create database tables:
python manage.py migrate
If you are need to use djiffy to access manifests that require an authorization token, use DJIFFY_AUTH_TOKENS in your project settings to configure each domain that requires an auth token. The configuration should be formatted like this:
DJIFFY_AUTH_TOKENS = { 'example.com': 'myauthtoken', }
Usage
Import IIIF content using the import_manifest manage command. This command can take an IIIF Collection or single Manifest, via local file or URL. Imported content can be viewed in Django admin.:
python manage.py import_manifest http://url.for/iiif/manifest python manage.py import_manifest /path/to/local/collection
Development instructions
This git repository uses git flow branching conventions.
Initial setup and installation:
recommended: create and activate a python 3.5 virtualenv:
virtualenv djiffy -p python3.5 source djiffy/bin/activate
pip install the package with its python dependencies:
pip install -e .
Unit Testing
Unit tests are written with py.test but use some 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]' pytest
Documentation
Documentation is generated using sphinx. To generate documentation, first install development requirements:
pip install -r dev-requirements.txt
Then build documentation using the customized make file in the docs directory:
cd sphinx-docs make html
To build and publish documentation for a release, add the gh-pages branch to the docs folder in your worktree:
git worktree add -B gh-pages docs origin/gh-pages
In the sphinx-docs folder, use make docs to build the HTML documents and static assets, add it to the docs folder, and commit it for publication on Github Pages. After the build completes, push to GitHub from the docs folder.
License
djiffy is distributed under the Apache 2.0 License.
©2019 Trustees of Princeton University. Permission granted via Princeton Docket #20-3618 for distribution online under a standard Open Source license. Ownership rights transferred to Rebecca Koeser provided software is distributed online via open source.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file djiffy-0.7.0.tar.gz
.
File metadata
- Download URL: djiffy-0.7.0.tar.gz
- Upload date:
- Size: 325.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b06d7545f3d7f259012e51e4d8279c6377e2d27a684b3845f37fc00429d3113b |
|
MD5 | 1371a5b86f6e0e06c53f102f03c73091 |
|
BLAKE2b-256 | 195e575c0e8d9c2fd870b49482a81e65eeff057ef44eea552acfbf76b6ddcf8e |
File details
Details for the file djiffy-0.7.0-py3-none-any.whl
.
File metadata
- Download URL: djiffy-0.7.0-py3-none-any.whl
- Upload date:
- Size: 380.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd5dd8acc441105d970430435acc5d1eba917723189582a2064b4f54bcb87e3 |
|
MD5 | a472b4dea47a102c8d9ae5cd9fe14991 |
|
BLAKE2b-256 | 8e9cc9e188983ac4d4c6ba98945bba5aece3403e287c6d811eb28524fc51f71b |