Skip to main content

djiffy

Django application to index and display IIIF Manifests for books

Unit Tests status Code Coverage PyPI - Python Version PyPI - Django Version Sphinx Docs build status

djiffy is intended to be a reusable Django application for working with digitized book-like content provided via IIIF Presentation manifests. This is an alpha version and it does not yet support the full IIIF Presentation specification.

Code documentation is available at https://princeton-cdh.github.io/djiffy/

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.9 virtualenv:

    virtualenv djiffy -p python3.9
    source djiffy/bin/activate
  • pip install the package with its python dependencies:

    pip install -e .

Upgrading to v1.0.0

If you have used any version of djiffy prior to v1.0.0, then it is required to upgrade to v0.9.2 first, and run all migrations on your Django project. The Django project must be running Django version 3.2 at this point.

After you have run those migrations, you can upgrade to any Django version 3.2+, and install djiffy v1.0.0.

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

As of v0.7.3, documentation is automatically built with GitHub Actions and published using GitHub pages.

Adding license images

When adding new license image SVG files to this repo, add id="licenseimg" to the <svg> element of each. This allows djiffy users to embed the SVG inline with a <use> tag, with its href attribute pointing to #licenseimg.

If the image will need to be recolored for different backgrounds, as in the case of the rightsstatement_org/ SVG icons, you can enable this for up to two tones in each SVG. To do this, set fill attributes on paths to fill="inherit" (controlled by the fill CSS property) or fill="currentColor" (controlled by the color CSS property).

License

djiffy is distributed under the Apache 2.0 License.

©2024 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.

Metadata

Release files for djiffy 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djiffy 1.0.3
File Size Uploaded Provenance Actions
djiffy-1.0.3.tar.gz 375.2 kB With provenance Details for djiffy-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for djiffy 1.0.3
File Interpreter ABI Platform Actions
djiffy-1.0.3-py3-none-any.whl Python 3 none any Details for djiffy-1.0.3-py3-none-any.whl

Total release size: 820.2 kB

Release files / djiffy-1.0.3.tar.gz

Download URL djiffy-1.0.3.tar.gz
Size 375.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2db0156269fc2b4055fe2fb17ea0628e4520c622e0632709f3f23a85d36207f5
BLAKE2b-256 checksum
How to use checksums
d16146a5ca66ee75e19d7e1b68c9d88bdd36d2e06340cee078e67b14db9eb896
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / djiffy-1.0.3-py3-none-any.whl

Download URL djiffy-1.0.3-py3-none-any.whl
Size 445.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
948910e89a35df05d0a269e955223804bbe8db26764d07f40c22e45aea3976e7
BLAKE2b-256 checksum
How to use checksums
bf50c0c1cfe9050633500cc20a535b2e02838499053e09a0cd80a0eba7ecab99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for djiffy 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for djiffy-1.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page