Skip to main content
complydoc

Document analysis for LLM pipelines, fully offline.

PyPI version PyPI downloads Tests Documentation License


complydoc inspects documents, and the output of document loaders, before they are sent to an LLM. It measures what processing them will cost, how reliably text can be read off each page, which personal and financial identifiers they contain, and whether anything hidden in a file is addressed to a model.

[!TIP] Run complydoc demo to produce a full report on the sample documents bundled with the package.

Quickstart

uv tool install complydoc
complydoc audit ./documents
import complydoc as cd

report = cd.full_audit("./documents")
print(report.overall.score)
cd.write_html(report, "report.html")

Output from a LangChain or LlamaIndex loader:

from langchain_community.document_loaders import PyPDFLoader

report = cd.inspect_documents(PyPDFLoader("contract.pdf"))

OCR and name detection are optional extras. complydoc doctor shows what is installed.

What it reports

  • Token cost: text and vision tokens per document, priced across models and three extraction paths (text layer, OCR, vision).
  • Extraction readiness: measured per-page signals such as text layer coverage, tables, columns, rotation, scan resolution and garbled characters.
  • Identifiers: personal and financial identifiers in UK, US and EU formats, checksum-validated where a checksum exists, masked in every output.
  • Hidden content and prompt injection: text a reader does not see and a model does (white or invisible text, hidden formatting, Unicode tag characters), and passages that read as instructions to a model.
  • Loader inspection and comparison: what a loader extracted, the metadata it attached, the network connections it attempted, and where several loaders disagree.
  • Masked text: the documents' text with identifiers covered, chunked and counted in tokens.
complydoc architecture: files and loader output feed four analyses (cost, readiness, identifiers, hidden content) that produce a report and masked text, inside a network guard

How it works

  • Offline: outbound sockets and DNS lookups are blocked for the whole run, and each report records that the guard was armed.
  • Measured, not inferred: a signal that cannot be measured is reported as not measured and left out of scores.
  • Evidence tiers: every finding states how it was established, whether by checksum, corroboration, pattern or model.
  • Configurable: prices, signal weights and detection patterns are YAML files.
  • One report: a self-contained HTML file and a JSON file with a versioned schema.

Resources

License

MIT

Release files for complydoc 0.3.1

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

Source distribution (sdist)

Source distribution for complydoc 0.3.1
File Size Uploaded
complydoc-0.3.1.tar.gz 3.7 MB Details

Built distribution (wheel)

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

Total release size: 6.6 MB

Release files / complydoc-0.3.1.tar.gz

Download URL complydoc-0.3.1.tar.gz
Size 3.7 MB
Tags Source
SHA-256 checksum
How to use checksums
6ed7904ef61d18a82bdbd628901ba025cfc8090ff879a2c17fb096e5be5d7b9a
BLAKE2b-256 checksum
How to use checksums
fa712ad70eafc87b42c224c3fd485ed1acae0b6fe66d9e8945ca77070db8c788
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 14, 2026.

Transparency log

Release files / complydoc-0.3.1-py3-none-any.whl

Download URL complydoc-0.3.1-py3-none-any.whl
Size 2.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
55d4999afed1f8aa24a29a4dd0fa49e19b019c752692710a60e3855c044ffeb2
BLAKE2b-256 checksum
How to use checksums
9d473f1668bc8f69f703457dd69cde94675fe600f69292cae3a17b0906c873fd
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 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

0.4.12

2 release files

0.4.11

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.1 This release

2 release files

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