Skip to main content

paratext logo  paratext

A modular, project-based pipeline that produces metadata from digitised library & archive collections with a multimodal model, built around human-in-the-loop.

A subject matter expert reviews a sample and helps iterate on the prompt until the accuracy is good enough to let it run over a full dataset. The focus is on good enough metadata for large collections rather than perfect metadata.

Version history for prompts and schemas is kept, so reviewers can see exactly what changed in the prompt and judge whether it helped. Extraction quality lives almost entirely in the prompt and the schema, which is where domain knowledge ends up: written down, versioned, deterministic and testable.

Approved and corrected records can also build a gold set: a fixed benchmark for measuring other models against the same material.

Run a model over a directory of images, PDFs or video, write resumable JSONL with provenance, package it for review, and export the approved results. Each project is a self-contained module, with its own prompt, schema and input handling, so the same code path runs a 50-item pilot and a 250,000-item sweep.

Every run on your own hardware records the electricity it used and what that emitted on your local grid, read from the machine's power sensors. Nothing is estimated: a run on a hosted model says "not measured". paratext carbon turns these figures into a report you can use in sustainability reporting. Runs can also pause while the grid is short of renewable power. See Carbon.

What you'll need

  • Your material: a directory of images, PDFs or video (video needs ffmpeg). Or metadata you already have, to review without running a model.
  • An OpenAI-compatible endpoint serving a model that accepts images. Local hosting (llama.cpp, vLLM, LM Studio, Lemonade etc) or a hosted provider — anything that speaks the OpenAI chat API.
  • uv

If you have no endpoint in mind, a hosted one takes two lines of config and no card — every Hugging Face account has a small monthly allowance:

base-url = "https://router.huggingface.co/v1"
model    = "Qwen/Qwen3-VL-30B-A3B-Instruct"

with your token in PARATEXT_API_KEY. A local server is the same shape: base-url = "http://localhost:8000/v1" and whichever model it serves.

Install

uv tool install paratext-cli

Upgrade with uv tool upgrade paratext-cli.

Quickstart

# 1. Scaffold a project: asks input type, fields and prompt, writes the config,
#    registers the entry point, runs `uv sync`. Ready to run.
#    Works in an empty directory (it offers to create the project for you) or
#    inside an existing one, where it nests into your package.
paratext new my-cards      # also asks for your endpoint and writes paratext.toml

# 2. Check what it will actually do before spending a model run on it.
paratext inspect -p my-cards

# 3. Extract, package, and review. Start small — the first thing you learn is
#    how wrong the prompt is, and five items tell you that as well as fifty.
paratext run -p my-cards --limit 5
paratext review

run writes the extraction JSONL and a review/my-cards-r1/ dataset; review opens a local web UI over everything under review/. Datasets are re-read per request, so a fresh run appears on reload without a restart.

inspect prints the fields the model is asked for, the prompt, the preprocessing applied, and whether schema, prompt and view still agree. It describes what is installed — so if it disagrees with the files you're editing, the package needs reinstalling. That mismatch is the most common cause of "my change did nothing".

paratext carbon shows the energy your runs used, with no setup needed. To add emissions, name your grid region in a [carbon] table in paratext.toml; paratext config --suggest-region proposes one for you to check.

Docs

  • Writing a project — setting a project up step by step: source, schema and prompt, model, review view.
  • Review and rounds — the run/review/edit loop, what a round is, verdicts, and building the gold set.
  • Choosing a review view — which fields reviewers see, and how to compare against an existing record.
  • Commands — every subcommand and what it is for.
  • Configuration — paratext.toml, resolution order, every key, hosted endpoints and environment variables.
  • Export — Hugging Face datasets, MARCXML and Dublin Core, and what makes up the gold set.
  • Scanned cards — verso filtering, card cropping and show-through suppression for index-card collections.
  • Carbon — energy and emissions for every run, a report for sustainability returns, and pausing while the grid is dirty.
  • Troubleshooting — what to check when the output is not what you expected.
  • HF export spec — the dataset layout, card and row fields a published round produces.
  • Publishing — cutting a paratext release to PyPI.
  • AGENTS.md — the guide for AI coding agents. paratext skill installs it where Claude Code, Codex and the rest look, so an agent finds it without being told.

Development

uv sync --extra dev            # add --extra detector for the card detector
uv run paratext …              # run the CLI against local source
uv run pytest -q               # tests
uv run ruff check              # lint

License

Apache-2.0 — see LICENSE and NOTICE. Copyright 2026 National Library of Scotland. The card-detector model weights are distributed separately on the Hugging Face Hub under their own license.

Metadata

Release files for paratext-cli 0.8.0

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

Source distribution (sdist)

Source distribution for paratext-cli 0.8.0
File Size Uploaded Provenance Actions
paratext_cli-0.8.0.tar.gz 704.2 kB Without provenance Details for paratext_cli-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for paratext-cli 0.8.0
File Interpreter ABI Platform Actions
paratext_cli-0.8.0-py3-none-any.whl Python 3 none any Details for paratext_cli-0.8.0-py3-none-any.whl

Total release size: 1.0 MB

Release files / paratext_cli-0.8.0.tar.gz

Download URL paratext_cli-0.8.0.tar.gz
Size 704.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d96584429c4529edc101d56468500b50d64b76e64065a66e77c153824af06e17
BLAKE2b-256 checksum
How to use checksums
e3d87353252214b05a200c8fbba99f4b1d81eb88f889bcb22cb432bb4498d340
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / paratext_cli-0.8.0-py3-none-any.whl

Download URL paratext_cli-0.8.0-py3-none-any.whl
Size 309.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9dfbfb419f643ba469f4b54ec02849399918f4f196e067b6f4d9103d7796553c
BLAKE2b-256 checksum
How to use checksums
12292839eeefa15f4f5b42e6602e232fc9ba33c441d70bbbf68b9e677403fde4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for paratext-cli 0.8.0

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.8.0 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