A Python package to download images from IIIF manifests
Project description
Download images from IIIF manifests
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 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
# 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iiif_download-0.1.5.tar.gz.
File metadata
- Download URL: iiif_download-0.1.5.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baeba2ba6051743c1a29d6b33c740c32ee292f72e57834703417dbefa4a4ae63
|
|
| MD5 |
fdcf6c33259119aaa4f4ff297defcad1
|
|
| BLAKE2b-256 |
460311bcb1afc949fa02935579aaf297b2bf18c734f9f19d7eba74a37e132bc2
|
File details
Details for the file iiif_download-0.1.5-py3-none-any.whl.
File metadata
- Download URL: iiif_download-0.1.5-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7009a036e71f82c5ca0d0c38442777720fc6631ab2127fbfaa37847c2a853b41
|
|
| MD5 |
a080d76a812578ec29ba849cdf4abc92
|
|
| BLAKE2b-256 |
3aeede7394b25add93fde2a1d89c0c3b682a09e0fbfc2253ba01672b3045349b
|