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.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 hooktestpi 1.0.2
File Size Uploaded
hooktestpi-1.0.2.tar.gz 42.1 kB Details

Built distribution (wheel)

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

Total release size: 88.7 kB

Release files / hooktestpi-1.0.2.tar.gz

Download URL hooktestpi-1.0.2.tar.gz
Size 42.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e5f261c6e7e4613d4515e72c5b2842cb1cd2531a87b116e9757d2e816dca7af7
BLAKE2b-256 checksum
How to use checksums
b8f8f53d0353de20666d2400c1c30f3c38d3d8d4a6d4849140574f24420e6e3e
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.2-py3-none-any.whl

Download URL hooktestpi-1.0.2-py3-none-any.whl
Size 46.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2de1d4176b50c628699c73409adcb59749e3748ac348e8ee07207a34dc1c6897
BLAKE2b-256 checksum
How to use checksums
0749cd0562b9ad5f192ccb8fd221b8bd4eddb22f6d257466756643d23967333e
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

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

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