This release is a pre-release and may not be stable for production use.
Document Evidence Lab
Local PDF parsing, deterministic validation and traceable evidence for document AI experiments. Part of Document Intelligence Lab.
The Python library runs without Java, Docker, an Azure account or an LLM. It adds evidence checks around Docling rather than replacing Docling's parser. The optional SDK connects to the existing Java platform for authenticated workflows and audit history.
Install
Use Python 3.10 or newer. Pin the alpha release and choose whether to install the optional parser:
python -m pip install 'document-evidence-lab[docling]==0.1.0a1'
For the dependency-free validation core and authenticated SDK, use document-evidence-lab==0.1.0a1 without [docling]. Installing the extra does not itself authorize a model download. This is research software; alpha releases are not production certifications.
Install from source
git clone https://github.com/quocvietphung/document-intelligence-lab.git
cd document-intelligence-lab
python3 -m venv .venv
source .venv/bin/activate
python -m pip install './python[docling]'
Use Python 3.10 or newer. On Windows, activate with .venv\Scripts\Activate.ps1. pip install ./python installs only the lightweight core and SDK; it does not install Docling or download models.
Read a local PDF
from document_evidence import DoclingReader, validate_document
# First use: explicitly permit downloading Docling's model weights.
document = DoclingReader(allow_model_download=True, timeout_seconds=900).read("invoice.pdf")
report = validate_document(document, required_labels=("Invoice no",))
print(document.pages[0].text)
print(report.to_dict())
First preparation caches layout, table and RapidOCR Torch weights, including OCR weights that a text-only invoice might not exercise. Later, DoclingReader().read("invoice.pdf") uses the prepared Docling model directory with Hugging Face offline mode and a DNS/socket audit guard in the conversion child process. Missing weights fail; there is no cloud fallback. This is an application safeguard, not an OS sandbox. Use artifacts_path="/path/to/prepared/models" for a separately prepared directory. Remote OCR/plugins are disabled. Initial preparation may need the explicit 900-second timeout; normal reads default to 180 seconds. Downloads require internet and disk space; local inference uses CPU/RAM, not a paid API. Test the OCR recognizer against your document language; counts and confidence are not accuracy guarantees.
document-evidence invoice.pdf --allow-model-download --timeout 900 --output private-result.json
The command refuses to overwrite an existing output file. The JSON contains document text: keep it private. Conversion runs in a short-lived Python child process for a bounded timeout and offline settings, not in a server or security sandbox. Defaults: unencrypted PDF, four pages, 3 MB, 180-second timeout. This standalone path has no ClamAV, authentication, queue or durable audit store; use only trusted/permitted PDFs, or use the Java workflow when those controls are required.
Check amounts and evidence without Docling
from document_evidence import normalize_money, validate_citations
result = normalize_money("2967,11 EUR")
assert str(result.amount) == "2967.11"
assert result.currency == "EUR"
answer = validate_citations("Invoice 51109301 [document:p1].", ["document:p1"])
Supported currency codes are EUR, INR, USD and GBP; ambiguous separators and unknown/mixed currencies remain findings. Source strings are unchanged. validate_citations checks source IDs, not whether a statement is factually supported. check_evidence(document, source_id, quote, value="...") adds exact quote/value containment. Neither check understands meaning or replaces human review.
Normalized results contain a SHA-256 document identity, page-bound source IDs, optional bounding boxes, table cells/spans and unknown confidence represented by None. These IDs identify this conversion; they are not interchangeable with Java dossier IDs. No human approval is inferred.
Optional Java SDK
import os
from document_evidence.client import PlatformClient
client = PlatformClient("http://localhost:8081", token=lambda: os.environ["LAB_ACCESS_TOKEN"])
workflow = client.workflow(os.environ["LAB_CASE_ID"])
Supply a Keycloak access token, not an Azure token or a password. The token callback can supply refreshed credentials; the SDK does not log in, store passwords or refresh automatically. Java enforces audience, tenant and roles. The client refuses redirects and plaintext remote origins. It does not invoke Nova implicitly.
Read methods: list_cases, get_case, workflow, trust, audit, batches. submit_pdf(case_id, path, consent=True, request_id="stable-uuid") explicitly uploads to the existing scanned batch queue. Reuse the same UUID and metadata when investigating an uncertain submission; there is no automatic retry. A returned intake receipt is not completed OCR or approval. Full platform setup and examples are in the repository README.
Development
python -m pip install './python[dev]'
python -m unittest discover -s python/tests -v
python -m build python
python -m twine check python/dist/*
Core tests do not download models. TEST_PYTHON_PDF=/private/path/invoice.pdf TEST_ALLOW_MODEL_DOWNLOAD=1 TEST_DOCLING_TIMEOUT=900 python -m unittest discover -s python/tests -p test_docling_smoke.py -v explicitly runs actual Docling. Omit the download flag after preparing weights. Shared repository fixtures check citations against Java and strict money rules against the Docker ETL worker; only an explicitly documented subset is compared with Java's permissive amount-comparison helper.
License
MIT for this package. Docling, model weights and source documents retain their own licenses. No model, publisher PDF, token or customer document is bundled in the wheel.
Metadata
Release files for document-evidence-lab 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| document_evidence_lab-0.1.0a1.tar.gz | 25.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| document_evidence_lab-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.4 kB
Release files / document_evidence_lab-0.1.0a1.tar.gz
| Download URL | document_evidence_lab-0.1.0a1.tar.gz |
|---|---|
| Size | 25.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67ee90319d40ff9a0c9edf972e6164bd9862c97cbd6c285a9d7acf172d11454b
|
|
BLAKE2b-256 checksum How to use checksums |
c30442cb6bcbe50f5fdea48190fc515ce57dbded7bfc305413771597ff212dae
|
| 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 Oct 24, 2026.
Transparency logRelease files / document_evidence_lab-0.1.0a1-py3-none-any.whl
| Download URL | document_evidence_lab-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1bffa94ee5c352c340be2b210ed75280deda7a36d49d8ea6042e237d811931d
|
|
BLAKE2b-256 checksum How to use checksums |
6f638c4a1dbe030624f6a5ef624715c16422f360ecd84eb27477304bc5c584b0
|
| 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 Oct 24, 2026.
Transparency logSecurity for document-evidence-lab 0.1.0a1
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for document_evidence_lab-0.1.0a1.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 Oct 24, 2026.
Transparency logA 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.