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.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: iiif_download-0.1.1.tar.gz
  • Upload date:
  • Size: 20.7 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.1.tar.gz
Algorithm Hash digest
SHA256 89b4f2863a084175093f816b6a720e4608a561f36c3b8eb0c14cdf555df5b492
MD5 547a5de115530e30dd0f7108c6c7a0d2
BLAKE2b-256 b024bd95269dc9bc8e033f5b70bf3f21ea147807aeb9ed6d392e9504e3da25c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iiif_download-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2054695c9f948a0562ceefb71ee604165d203a22e8fa45f19634f235165fd96d
MD5 58e1d13dcf73d486399e6efc251cb462
BLAKE2b-256 96aeb570c043c283d09a1d4ac2c198be4d8033b5e869b556684362be8cc7a773

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