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

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

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 IIIFDownloader, config 

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

# Use downloader with global config
downloader = IIIFDownloader()

# or override the global config for a specific downloader
downloader = IIIFDownloader(
    max_dim=2000,  # surcharge config.max_size
    img_path="path/to/dir"  # surcharge config.img_dir
)

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

# Download images from a manifest inside img_path/dir_name
downloader.download_manifest(manifest, save_dir="dir_name")

Command line

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

venv/bin/python run.py -f test-manifests.txt

Metadata extraction

from iiif_download import IIIFManifest

manifest = IIIFManifest("https://example.org/manifest")
manifest.load()
lic = manifest.licence
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.0.tar.gz (18.6 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.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iiif_download-0.1.0.tar.gz
  • Upload date:
  • Size: 18.6 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.0.tar.gz
Algorithm Hash digest
SHA256 eb40b23de59d5b2120fbce02ba49685bc98a058e27c86d169c21033e5cd7e5dc
MD5 9684e836413d557da41c6a9068b39791
BLAKE2b-256 c00d60c3efc4c14b1b56fe877250fb38d5d239f5887f719c6198138e28098127

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iiif_download-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c793d1d86fa64a0ca5487e38fb6fa33f4391372bfab96d8547bb0b09e249491c
MD5 4ec5359eff7b4a80a4bfb402b0e70d72
BLAKE2b-256 847554e0fcd093e254909cf55f4ca27916afc324113a1e08e93646c1129b6f9a

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