Skip to main content

hooktestpi

Validation for CapiTainS/CTS corpora of TEI digital editions. A port of HookTest for Python 3.14.

Checks the data/<textgroup>/<work>/ layout, every __cts__.xml, URN/filename agreement, citation passages, RelaxNG validation, <div> ordering and xml:id uniqueness — then writes a manifest.txt of everything that passed.

Install

python3.14 -m venv .venv
.venv/bin/pip install hooktestpi

Validation

Validation is reference-grade only. The default backend is Jing (the reference implementation, shipped with the package; Java required). Without Java, the relaxng-rust rng binary is the fallback — same verdicts, no JVM — found through HOOKTESTPI_RNG or PATH. Until the upstream datatype fixes are released, build it from the patched source:

git clone https://github.com/mgbplusclaude/relaxng-rust -b fix-xml-datatype-library-resolution
cargo build --release -p relaxng-tool --manifest-path relaxng-rust/Cargo.toml
export HOOKTESTPI_RNG=$PWD/relaxng-rust/target/release/rng

Schemas are pulled from their canonical sources and cached — the current EpiDoc schema for Perseus, tei-pta.rng for the Patristic Text Archive, TEI-all from tei-c.org. Nothing is bundled, so validation always reflects the published standard. Keep copies in --schema-dir DIR to run offline.

Use

# Patristic Text Archive (console output and manifest.txt are defaults)
hooktestpi ./pta_data --cts-project pta -v 7

# Perseus, with word counts and a JSON report
hooktestpi ./canonical-greekLit --cts-project perseus -v 7 --countwords -j report.json

# One textgroup, work or version; or straight from a git remote
hooktestpi ./corpus -f tlg0012.tlg001
hooktestpi https://github.com/PerseusDL/canonical-greekLit --cts-project perseus

# Older editions: the schema as it stood when they were released
hooktestpi ./corpus --cts-project pta --schema-date 2025-06-01

# Legacy pre-EpiDoc conversions: generic TEI-all, URN on <text>/<body>
hooktestpi ./corpus --tei-p4

# CI: no console chatter, no manifest
hooktestpi ./corpus --quiet --no-manifest

Build a release containing only the passing files:

hooktestpi-build ./corpus --ci --txt --cites --tar

Exit 0 if everything passed, 1 if anything failed, 2 if the corpus could not be read.

MIT (LICENSE); files derived from HookTest remain MPL-2.0 (LICENSE.MPL-2.0).

Metadata

Release files for hooktestpi 1.0.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 hooktestpi 1.0.0
File Size Uploaded
hooktestpi-1.0.0.tar.gz 42.1 kB Details

Built distribution (wheel)

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

Total release size: 88.6 kB

Release files / hooktestpi-1.0.0.tar.gz

Download URL hooktestpi-1.0.0.tar.gz
Size 42.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5ebfc0cf7d6d0d2c332895d944c08ea010ffe31cda8cb33e81da4bc0955da48b
BLAKE2b-256 checksum
How to use checksums
8d49d6ab73b801a700e0c343ba52dc0d2a7c3118f9105e1e34e75a4b13b1a425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release files / hooktestpi-1.0.0-py3-none-any.whl

Download URL hooktestpi-1.0.0-py3-none-any.whl
Size 46.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b8c4ea88fa812544f180f0123e7c778e8af8307f1d3f8ffb4b669c3cbd19b08
BLAKE2b-256 checksum
How to use checksums
8979cfce3996c3097cafb415f090deecd69b1ce56992b2b4556f7cd214d512b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

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