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

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

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.10.tar.gz (24.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.10-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iiif_download-0.1.10.tar.gz
  • Upload date:
  • Size: 24.1 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.10.tar.gz
Algorithm Hash digest
SHA256 86af1bedb14f0cbcfba43fbc0bf2375ed8012a389aa93d6564fab1746d0db986
MD5 5341843b0d4a6c375fcb843eec8d4d32
BLAKE2b-256 d5d4d26547bc112e06515661a6781c65797bf74fb7556229552a59cdc9d97cf6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iiif_download-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 22.7 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 40243034871700ccdef59929e38eb871dd2ea7bb55c230cdb423d712d6fc197e
MD5 2f36cb00ac04dc6e1ddaeff5f562aab2
BLAKE2b-256 6f3f1059e2193a9c00cc2aff48a8ad47ee9792e33f4a8b8928866bfcf8ac421c

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