Skip to main content

APIs et interfaces de stockage de médias.

Project description

Jamā (जमा)

Jamā is a Django-based media repository application developed at CERTIC, Université de Caen Normandie. It provides APIs and user interfaces for storing, organizing, enriching, and serving collections of media resources.

It is packaged as jama-CERTIC and installs a jama command, which behaves like a standard Django management command entry point.

Features

  • Projects, collections, resources, files, metadata, and access control.
  • JSON-RPC API and web UI.
  • Chunked file uploads and hash-based source-file storage.
  • Background media processing with Django Tasks and django-tasks-db.
  • IIIF tiled image generation for image and document resources.
  • HLS generation for videos.
  • OCR and ExifTool metadata extraction.
  • Optional ARK identifier integration.
  • Project snapshot export and restore commands.
  • Optional PostgreSQL/PostGIS deployment; SQLite is available for small or test instances.

Requirements

Jamā requires Python 3.13 and Django 6.

Some features depend on external command-line tools that must be installed on the host system:

  • ImageMagick (convert) for image conversion.
  • Poppler (pdftoppm, pdftotext) for PDF processing.
  • libvips (vips) for IIIF tiled image generation.
  • Tesseract for OCR.
  • ExifTool for technical metadata extraction.
  • FFmpeg/FFprobe for video processing and HLS generation.

For production deployments, use a real web server, a separate task worker, and PostgreSQL when the instance will handle significant traffic or concurrent use.

Installation

pip install jama-CERTIC

Initialize the database and create an administrator account:

jama migrate
jama createsuperuser

Start a development server:

jama runserver

By default, Jamā stores persistent data under $HOME/.jama/.

Background Tasks

Jamā uses Django Tasks with the database backend provided by django-tasks-db. Start at least one worker to process media jobs such as IIIF tiling, OCR, HLS generation, ExifTool extraction, ARK assignment, and bulk metadata updates:

jama db_worker

Recurring tasks are registered and run through django-crontask:

jama crontask --no-heartbeat

In production, run the web process, one or more db_worker processes, and the cron process separately, for example with systemd.

Configuration

At startup, Jamā reads environment variables and also loads an env file from JAMA_VAR_DIR. If the file does not exist, Jamā creates it automatically with documented defaults.

Important variables include:

JAMA_VAR_DIR="$HOME/.jama"
JAMA_SECRET="change-me"
JAMA_SITE="http://localhost:8000/"
JAMA_STATIC_ROOT="$HOME/.jama/static"

JAMA_DB_ADAPTER="sqlite"          # use another value for PostgreSQL
JAMA_SQLITE_DB_PATH="$HOME/.jama/db.sqlite3"
JAMA_DB_HOST="localhost"
JAMA_DB_PORT="5432"
JAMA_DB_NAME="django"
JAMA_DB_USER="django"
JAMA_DB_PASSWORD="django"

JAMA_FILES_DIR="$HOME/.jama/media_source_files"
JAMA_IIIF_DIR="$HOME/.jama/iiif"
JAMA_IIIF_PROCESSING_DIR="$HOME/.jama/processing"
JAMA_IIIF_ENDPOINT="http://localhost/iip/IIIF="
JAMA_HLS_DIR="$HOME/.jama/hls"
JAMA_HLS_ENDPOINT="http://localhost:8000/hls/"

See configuration.md in the source repository for the complete list of supported settings.

Useful Commands

jama --help
jama collectstatic
jama listprojects
jama newjamaproject "Project title"
jama addlocalfiles /path/to/files username PROJECT_ID --extensions .jpg .tif
jama ensureiiif
jama snapshotproject PROJECT_ID /path/to/snapshot --include-files
jama restoreproject /path/to/snapshot "Restored project"

The jama repl command starts a Django-aware interactive shell with commonly used Jamā models and helpers imported.

Project Snapshots

Jamā can export a project as a restorable snapshot. A snapshot is a directory containing NDJSON data files and a manifest.json file.

List projects and their identifiers:

jama listprojects

Export database data only:

jama snapshotproject PROJECT_ID /path/to/snapshot

Export database data and original source files:

jama snapshotproject PROJECT_ID /path/to/snapshot --include-files

Restore a snapshot into a new project:

jama restoreproject /path/to/snapshot "Restored project"

Replace an existing project while keeping its identifier:

jama restoreproject /path/to/snapshot "Existing project" --replace-in-place

When --replace-in-place is used, Jamā creates a safety snapshot before replacing the project. Source files are optional in snapshots; without --include-files, the database rows are restored but the original files must already be present in Jamā storage for media resources to be fully usable.

Derived IIIF and HLS files are not included in snapshots. They are regenerated after restore when the source files are available. Annotations are not included in the current snapshot format.

IIIF Notes

Jamā generates tiled image files and expects an IIIF-compatible image server to serve them. IIPImage and Cantaloupe are typical choices. The exact JAMA_IIIF_ENDPOINT, path separator, and WebP settings depend on the chosen server.

For Cantaloupe 5.x, a common configuration is:

JAMA_USE_WEBP=0
JAMA_IIIF_PATH_SEPARATOR="%2F"
JAMA_IIIF_ENDPOINT="http://localhost:8182/iiif/2/"

Documentation and Source

The project repository is:

https://git.unicaen.fr/certic/jama

The source repository contains additional documentation, configuration details, and example systemd units.

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

jama_certic-0.6.4.tar.gz (6.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jama_certic-0.6.4-py3-none-any.whl (7.1 MB view details)

Uploaded Python 3

File details

Details for the file jama_certic-0.6.4.tar.gz.

File metadata

  • Download URL: jama_certic-0.6.4.tar.gz
  • Upload date:
  • Size: 6.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for jama_certic-0.6.4.tar.gz
Algorithm Hash digest
SHA256 4e7d20da73ecb374753ae354f397f0ea83729e736fed3c19c3896884463d9bec
MD5 619a714a6fd3b364a5c4ef0efcba5858
BLAKE2b-256 a39c6ab321f5534c202a436a159f312f8d54def362c6ead6cc776dd4dbcd43d0

See more details on using hashes here.

File details

Details for the file jama_certic-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: jama_certic-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 7.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for jama_certic-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4fedb1a974663ddb443916501d849c69826e8c3139b75e207c3f61cde5e8b400
MD5 737f30a5c2ab07d4a9996380ea452bf6
BLAKE2b-256 573f77d4574d8e75f639f3fea43e57ce5c6dec3199ea475288da020904549566

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page