Skip to main content

TableProof

CI

TableProof finds suspected errors in extracted PDF tables. It compares cell text and row or column positions with source evidence.

Every number can survive extraction while its row label changes. TableProof reports the disputed cell and its original PDF region.

This is an alpha Python library. It needs Python 3.11 or later.

Installation

python -m pip install table-proof-py
table-proof source.pdf docling-export.json --html report.html --json report.json

docling-export.json is a Docling document export with table cells and source coordinates.

For the optional local vision model, install the extra dependencies:

python -m pip install 'table-proof-py[vision]'

Try the real regression case

The recorded regression pair contains this error:

Source row Affected extracted row Result
BBB → 20.0 mg CCC → 20.0 mg Row label differs from the source region.
CCC → 30.0 mg BBB → 30.0 mg Row label differs from the source region.

The regression fixtures are in the source repository. Run these commands:

git clone https://github.com/eduard-s/table-proof.git
cd table-proof
python3 -m venv .venv
.venv/bin/python -m pip install -e .
.venv/bin/table-proof \
  benchmarks/fixtures/docling_5198/source.pdf \
  benchmarks/fixtures/docling_5198/affected.json \
  --html report.html --json report.json

The command exits with code 1. It reports two swapped row labels in the affected fixture.

Replace affected.json with fixed.json to examine the paired control. That command exits with code 0.

The fixture reproduces a real Docling defect on a generated PDF. It does not represent an independent production document.

Read the benchmark results and fixture provenance.

Python API

import json
from pathlib import Path

from table_proof import audit_tables

fixture = Path("benchmarks/fixtures/docling_5198")
document = json.loads((fixture / "affected.json").read_text())
report = audit_tables(fixture / "source.pdf", document)

print(report.status)
report.export_json("report.json")
report.export_html("report.html", source_pdf=str(fixture / "source.pdf"))

The adapter accepts Docling JSON, a DoclingDocument, or a conversion result with a document field. Docling is optional at runtime.

Rich cells can contain text references. The adapter resolves the references that control the rendered table. It does not trust stale cell text.

What the MVP does

  • Compares cell tokens with PDF words in the cell region.
  • Detects reversed row or column positions and invalid cell spans.
  • Reports missing source text, incomplete geometry, and ambiguous word assignments.
  • Produces JSON findings and local HTML evidence.
  • Preserves the source PDF and extraction.
  • Supports an optional, pinned Table Transformer model for independent structure evidence.

The default path uses PDF text and geometry. It makes no network requests.

The optional model runs locally. It needs an explicit download option before its first use. Read the vision guide.

Results and limits

Status Meaning CLI exit code
no_findings The selected checks found no error in the supplied evidence. 0
review At least one check found a suspected error. 1
uncertain Evidence is missing, ambiguous, or unsupported. 3
error The command did not process the input. 2

no_findings does not prove semantic accuracy. An empty table list returns uncertain.

Start with digital PDFs and tables that occupy one page. Scans and multi-page tables need other methods.

The tool does not certify units or source facts. It does not repair data automatically. Detector scores are not calibrated error probabilities.

The small development benchmark compares TableProof with local controls and pinned upstream pdfmux code. Its cases establish a reproducible regression result. They do not establish broad superiority on real documents.

On the included public paper, TableProof flags six missing headers. It returns uncertainty for a clipped superscript in another parser output.

The optional vision model recovers the table grid but adds no error detection on that public example. Read the recorded model results before a model accuracy claim.

Development

.venv/bin/python -m pip install -e '.[dev]'
.venv/bin/ruff check .
.venv/bin/ruff format --check .
.venv/bin/mypy src/table_proof
.venv/bin/pytest --cov=table_proof --cov-report=term-missing
.venv/bin/python -m build
.venv/bin/python -m twine check dist/*

Use Python 3.12 for the type analysis. CI runs tests on Python 3.11 through 3.14.

Documents

License

MIT. See LICENSE and third-party notices.

Metadata

Release files for table-proof-py 0.1.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 table-proof-py 0.1.0
File Size Uploaded Provenance Actions
table_proof_py-0.1.0.tar.gz 663.0 kB With provenance Details for table_proof_py-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for table-proof-py 0.1.0
File Interpreter ABI Platform Actions
table_proof_py-0.1.0-py3-none-any.whl Python 3 none any Details for table_proof_py-0.1.0-py3-none-any.whl

Total release size: 687.0 kB

Release files / table_proof_py-0.1.0.tar.gz

Download URL table_proof_py-0.1.0.tar.gz
Size 663.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a1878fb424268e9d7e9c9369c6baecc37e62336ba2c284d7d6523404152e6234
BLAKE2b-256 checksum
How to use checksums
5b532855af71f37bf6f6c991f666db33acfac5ba1eb5d1a504443725d6cb69e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 8, 2026.

Transparency log

Release files / table_proof_py-0.1.0-py3-none-any.whl

Download URL table_proof_py-0.1.0-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
449e969a05e05a03f5606a4408e4e20c3a009bf35b20aad73207bc4a5603a3aa
BLAKE2b-256 checksum
How to use checksums
f03aa032ce2b32935dda7c2c5ad6081bb816d5c8ad8f180afa76efb1211a4d83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 8, 2026.

Transparency log

Security for table-proof-py 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for table_proof_py-0.1.0.tar.gz

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 Nov 8, 2026.

Transparency log

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.1.0 This release

2 release files Full 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