Skip to main content

A Python package to download images from IIIF manifests

Project description

Download images from IIIF manifests

PyPI - Version PyPI - Python Version Test Status

This repository contains code to download images from IIIF manifests. It takes into account limitations and data specificities from various institutions.

pip install iiif-download

Basic usage

The configuration is stored in iiif_download/config.py and can be overridden by setting environment variables.

Inside a script

from iiif_download import IIIFManifest, config, Config

# Override the default configuration
config.max_size = 2500
config.img_dir = "custom/path/to/images"

manifest_url = "https://example.org/manifest"

# Use global config
manifest = IIIFManifest(manifest_url)

# or override the global config for a specific manifest
manifest = IIIFManifest(
    manifest_url,
    # surcharge any global attribute locally
    img_dir="path/to/dir",
    max_size=4000
)

# or define another config
manifest = IIIFManifest(manifest_url, config=Config(is_logged=False))

# Download images from a manifest inside img_dir/dir_name
manifest.download(save_dir="dir_name")

Command line

# override specific variables
export IIIF_IMG_DIR=custom/path/to/images
export IIIF_MAX_SIZE=4000
export IIIF_DEBUG=True
# or use .env
source .env

iiif-download https://example.org/manifest
iiif-download -f test-manifests.txt
iiif-download -d custom/path/to/images https://example.org/manifest

Metadata extraction

from iiif_download import IIIFManifest

manifest = IIIFManifest("https://example.org/manifest")
manifest.load()
lic = manifest.license
author = manifest.get_meta("author")
images = manifest.images

Development

Install locally

python -m venv venv && source venv/bin/activate
pip install -e ".[dev]"

Run tests

pytest
# pre-commit install
pre-commit run --all-files

Publish on PyPi

git tag v<*.*.*> && git push origin v<*.*.*>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iiif_download-0.1.17.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

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

iiif_download-0.1.17-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file iiif_download-0.1.17.tar.gz.

File metadata

  • Download URL: iiif_download-0.1.17.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for iiif_download-0.1.17.tar.gz
Algorithm Hash digest
SHA256 c5f81ce559d0db1cdd927b20225b480f19f3c16cc0ea5cfc0a57d522f68720b1
MD5 5674007008a4e2dc20a227cb51e254ee
BLAKE2b-256 53fdf3482dd8429fcd3e019e85dd6763d35c17a76de2b6c79d1f3d170e008012

See more details on using hashes here.

Provenance

The following attestation bundles were made for iiif_download-0.1.17.tar.gz:

Publisher: release.yml on Segolene-Albouy/iiif-download

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iiif_download-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: iiif_download-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for iiif_download-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 a10612e8a9f9f8d64ef6b079cf279092da6942cb5f8b34f9d2d5eb00bac37d0d
MD5 c18a45bccf89666ce947f610eb44c252
BLAKE2b-256 f1bb210e00bbfb499b44d6d3684e9e5a3629a311812dbe7ceed20002a71a98a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for iiif_download-0.1.17-py3-none-any.whl:

Publisher: release.yml on Segolene-Albouy/iiif-download

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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