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 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(
    img_dir="path/to/dir"  # surcharge any global attribute
)

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

# Download images from a manifest inside img_dir/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

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.4.tar.gz (22.2 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.4-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iiif_download-0.1.4.tar.gz
  • Upload date:
  • Size: 22.2 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.4.tar.gz
Algorithm Hash digest
SHA256 a6acc372a7dc0a1af86c34affa7a4ca6720ce88761a76811210d4e03ce303c97
MD5 bd221cfae91a2e8b9a131bd4ce8e4338
BLAKE2b-256 a0ed0b5ec3b55daef26b0bf521d7be101fbf7c34077a672a8c7594557e21f557

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iiif_download-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 21.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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a06e93e3757dd91ceb470e434b039c324f824e9bb80ecdc49864a1ed8ce2c6ae
MD5 4f924ac467149683a9d24db0cbcf19b4
BLAKE2b-256 033591460f6275d66955e525e8c6509bed60f14355e806bc6825f5f0f89f2a4b

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