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 overriden 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
# or use .env
source .env

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

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.get_images()

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.6.tar.gz (22.8 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.6-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iiif_download-0.1.6.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for iiif_download-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a4a77d0d7cb19afbef66cc4a9b71b7d1deafaea2e3a02ab0053b057ce55556c9
MD5 f3b0f7ff0d044cafc74d2dde394dbf57
BLAKE2b-256 0f41bc9bd499da32041fc34fcd9548325d49b2d5669fa581be21d94356524d06

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iiif_download-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for iiif_download-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1fdcd82785bf60f0cec8099980181e4d847425b91e01980b4dd6de07ff67a097
MD5 6c01ff7efcd10a5d023a40a5074c459b
BLAKE2b-256 e65c7f794c0873918ed63789251f2b025c5858b7ed00fb10e6115428efc1c9d1

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