Skip to main content

griiist

IIIF-to-dataset tooling for ML/RAG. Millions of openly licensed, richly described images sit behind IIIF endpoints in the world's galleries, libraries, archives, and museums — and there is no polite, resumable, rate-limited harvester that crawls whole collections, resolves rights, downloads at a chosen resolution, and emits ML-ready datasets with metadata intact. Existing IIIF downloaders are single-manifest CLI tools. griiist connects the cultural-heritage world to the ML world in a way neither community has built.

The idea in one line

Point griiist at an IIIF Collection; get back a HuggingFace dataset / WebDataset shards / embedding-ready parquet of only the images you're licensed to use, with their metadata and provenance intact.

How it's structured: catalog, then materialize

The central design choice is to separate the cheap metadata crawl from the expensive image download. At millions-of-images scale these are different operations and must not be conflated.

  1. Catalog — a metadata-only crawl. Walk IIIF Collections → Manifests → Canvases and build a queryable local index of everything available: image identifiers, info.json capabilities, resolved rights, and flattened metadata. No image bytes. Fast, polite, laptop-sized even for large collections.
  2. Materialize — take a filter over the catalog and produce a dataset: download images at the chosen resolution, package into the target format with metadata and provenance intact.

Crawl an institution once, then produce many filtered datasets — "only CC0 paintings > 2000px", "a 10k random sample for a prototype" — without re-hitting their servers. The rights filter is inspectable before anything is downloaded, and the expensive half is trivially resumable because its work-list is a static, checkpointed table.

Pipeline

Four decoupled, individually checkpointed stages:

discover  →  filter/select  →  fetch  →  package
(catalog) ────────────────┘   └──── (materialize) ────┘

Decoupling fetch from discover is what lets a harvest be interrupted and resumed without re-crawling or re-downloading.

Materialize writes its output as numbered shards inside the --out directory and records each image's progress in the catalog. Rerun the same command to resume an interrupted run; images that failed are recorded rather than aborting the run, and --retry-failed retries them.

What "correct" means here

These are load-bearing requirements, not nice-to-haves:

  • Level-0 aware. IIIF Image API compliance varies. Many institutional servers are level 0 and serve only pre-generated sizes listed in info.json, not arbitrary !w,h. griiist reads info.json and negotiates to the closest available size rather than assuming it can request anything.
  • Conservative rights allowlist. RightsStatements.org includes "In Copyright" statements; richly described ≠ openly licensed. griiist normalizes CC and RightsStatements.org URIs (and the Presentation 2.x license/attribution vs 3.0 rights/requiredStatement split) and, by default, emits only affirmatively-open items. Unresolvable rights → excluded, not included.
  • Lossless metadata. IIIF metadata is heterogeneous, localized, free-form. Every record carries both a normalized subset (image_id, manifest_uri, canvas_id, label, dimensions, rights, attribution, provider) and the raw manifest JSON.
  • Provenance as output. Every record carries its source URI, the exact size parameters requested, harvest timestamp, and tool version — so a dataset is reproducible and its licensing is auditable.
  • Polite and resumable. Per-host rate limiting with backoff and Retry-After handling; a conservative global default with per-institution overrides. Any harvest is interruptible and resumes without lost or duplicated work.

Politeness

Every request (catalog crawl and image download alike) goes through one paced client. By default griiist allows 1 request per second and 2 in flight per host, which is safe for a small institution's server. It honors Retry-After on 429/503 by pausing all requests to that host, and retries transient failures with exponential backoff. Requests identify themselves with a griiist/<version> User-Agent. Different hosts proceed independently, so one slow server doesn't hold up the rest.

For a host you know can take more, raise its limit:

griiist materialize --out ds --rate images.example.org=10 --concurrency 16

--rate HOST=RPS is repeatable. --default-rate and --host-concurrency change the defaults for every other host, and work on griiist catalog too.

Built on iiisight

griiist is a Python application built on iiisight, the tolerant, async IIIF read client. iiisight handles the IIIF side — collection/manifest/canvas traversal, Presentation v2→v3 normalization, and info.json-aware Image API requests — so griiist can focus on what makes it a harvester: rights filtering, polite resumable crawling at scale, cataloging, and dataset packaging. The split is deliberate: iiisight is the reusable read substrate; griiist is one application built on it.

Outputs

  • HuggingFace datasets — parquet-backed, ready to load_dataset / push to the Hub.
  • WebDataset — tar shards for large-scale streaming training.
  • Parquet — clean, well-schematized, ready for a downstream embedding pipeline.

All three are written as numbered shards inside the --out directory, never as a single file: shard-NNNNNN.tar (WebDataset), part-NNNNNN.parquet (parquet; read the directory with pyarrow.parquet.read_table(out)), or train-NNNNNN.parquet (HuggingFace; load with load_dataset("parquet", data_dir=out), not load_from_disk).

Non-goals

Not a IIIF viewer. Not a general web scraper — it uses the structured IIIF APIs only. Not an embedding/inference engine ("embedding-ready" means the parquet is clean and schematized, not that griiist runs models). No image editing beyond resolution selection.

Name

"griiist" ≈ grist — grain brought to the mill for grinding; grist for the mill is raw material to be processed. The tool turns IIIF collections into grist for the training mill. The extra is echo IIIF.

Metadata

Release files for griiist 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for griiist 0.2
File Size Uploaded Provenance Actions
griiist-0.2.tar.gz 64.3 kB Without provenance Details for griiist-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for griiist 0.2
File Interpreter ABI Platform Actions
griiist-0.2-py3-none-any.whl Python 3 none any Details for griiist-0.2-py3-none-any.whl

Total release size: 97.3 kB

Release files / griiist-0.2.tar.gz

Download URL griiist-0.2.tar.gz
Size 64.3 kB
Tags Source
SHA-256 checksum
How to use checksums
609a9d49d6d607780703775c360fe5a9cab7ecc9c23c919651a452e8be5f49dd
BLAKE2b-256 checksum
How to use checksums
95ea7a3604883d20f30801764c98be0bf70e15dd5ba2e4d759ee74ebab366972
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / griiist-0.2-py3-none-any.whl

Download URL griiist-0.2-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bab6b97d44b063e400300edf3376ec7284f06fb79c478b6ec47e4243ed7e051
BLAKE2b-256 checksum
How to use checksums
ef2b4099a07905014acff6a9eb88a95062c4e6c96e2b5562974ef3f7983a4bd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.15

Security for griiist 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page