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 config.img_dir
)

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

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.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.2.tar.gz (20.0 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.2-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iiif_download-0.1.2.tar.gz
  • Upload date:
  • Size: 20.0 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.2.tar.gz
Algorithm Hash digest
SHA256 beaf3f9a64aec3dd02e66024b7c15186fabf09870e9d3afd577f8654490974a4
MD5 c0043e607720b18a28205aa1a52fafec
BLAKE2b-256 fdfff6f812e7ed99f9d73758122e682a456c81eacbcc0c829e6f1a6694b475a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iiif_download-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cacb025adc7fbe056c3858e537f1410264b572f462ffa1ec100a6cc8e95214bb
MD5 35e881630b2caa65974175970e2273d6
BLAKE2b-256 8962e7250c15d195260701dee35d8222bcf2124b2002ee5da73e57ff8d44e10d

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