No single document repo completes the job.
The closest individual library is python-docx because Harrison's instructions require direct access to actual document structure. The credible minimum is python-docx + openpyxl + pypdf + Pydantic. Optional workers are introduced only for failing fixtures.
Harrison-fit requirements
Twelve strongest document references
docxtemplater
Parses tags inside OOXML ZIP parts, resolves loops/conditions and writes a new DOCX.
- Fit
- Strong JS templating; test split runs, headers, tables and paid-module licensing.
python-docx-template
Embeds Jinja-like tags into Word templates and renders new files from context.
- Fit
- Useful for controlled net-new templates; existing masters may require surgical logic.
python-docx
Manipulates paragraphs, runs, tables, sections and related structures from Python.
- Fit
- Best direct base; add OOXML helpers for comments, fields, metadata and complex parts.
Open XML SDK
Microsoft's strongly typed .NET object model for WordprocessingML, SpreadsheetML and PresentationML.
- Fit
- Best authoritative structural reference; adopting .NET would split the worker stack.
ClosedXML
Higher-level .NET workbook manipulation over Open XML.
- Fit
- Good usability reference; unnecessary if Python worker uses openpyxl.
openpyxl
Loads and edits cells, formulas, styles, worksheets and workbook metadata in Python.
- Fit
- Register census and controlled edits; test formulas, validations and styles on real files.
pypdf
Inspects PDF objects, pages and AcroForm fields and can update compatible form values.
- Fit
- First probe; classify XFA, appearances, signatures and flattening before promises.
qpdf
CLI/library for structural inspection, repair, transformation and normalisation of PDFs.
- Fit
- Useful when Commission forms contain structural quirks that pypdf alone cannot handle.
Docling
Layout-aware local parsing of PDFs and office documents into structured representations.
- Fit
- Add only when simple parsers fail measured tables/layout fixtures.
OCRmyPDF + Tesseract
Adds searchable OCR layers to scanned PDFs using a mature OCR engine.
- Fit
- Fallback for scans; confidence and visual QA remain mandatory.
Gotenberg
Containerised office/HTML-to-PDF conversion service with API-driven rendering.
- Fit
- Versioned preview/conversion worker; does not prove source DOCX correctness.
Documenso
Document preparation, recipients, signing requests, completion and audit events.
- Fit
- Reference for declarations/signing; do not make it application authority prematurely.
Minimum combination
| Layer | Repository | Owns | Does not own |
|---|---|---|---|
| Contracts | Pydantic | Typed jobs, manifests and validation | Regulatory meaning |
| DOCX | python-docx | Word structure/edit mechanics | Source precedence or approval |
| XLSX | openpyxl | Workbook inspection and edits | Register semantics |
| pypdf | Object/form mechanics | Field authority or submission |
Immediate probe order
- 1DOCX corpus
Runs, tables, headers, footers, comments, highlights, fields and metadata.
- 2XLSX controls
Values, formulas, validation, styles and deterministic register census.
- 3Commission PDF classification
AcroForm/XFA, appearances, signatures, save/reopen and round-trip visual proof.
- 4Artifact receipt
Input hash, edition, replacements, census, validation, output hash and approval state.