Skip to main content

langchain-docdigitizer

LangChain document loader for the DocDigitizer document processing API.

v0.1.x is deprecated. Upgrade to v0.2.0+ for the new API endpoint. The previous endpoint (https://apix.docdigitizer.com/sync) will be removed in a future release.

Installation

pip install langchain-docdigitizer

Usage

from langchain_docdigitizer import DocDigitizerLoader

# Load a single PDF
loader = DocDigitizerLoader(api_key="dd_live_...")
docs = loader.load("invoice.pdf")

print(docs[0].page_content)       # JSON with extracted fields
print(docs[0].metadata)           # document_type, confidence, country_code, etc.

# Load all PDFs from a directory
loader = DocDigitizerLoader(api_key="dd_live_...", file_path="invoices/")
docs = loader.load()

# Use in a RAG pipeline
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_openai import OpenAIEmbeddings
from langchain_community.vectorstores import FAISS

splitter = RecursiveCharacterTextSplitter(chunk_size=1000)
chunks = splitter.split_documents(docs)
vectorstore = FAISS.from_documents(chunks, OpenAIEmbeddings())

Configuration

Parameter Environment Variable Default
api_key DOCDIGITIZER_API_KEY —
base_url DOCDIGITIZER_BASE_URL https://api.docdigitizer.com/v3/docingester
timeout DOCDIGITIZER_TIMEOUT 300
max_retries — 3
pipeline — None
content_format — "json"

Content Formats

  • "json" (default): page_content is a JSON string of extracted fields
  • "text": page_content is key-value pairs separated by newlines (key: value)
  • "kv": page_content is key=value pairs separated by newlines

Document Metadata

Each LangChain Document includes metadata:

Field Type Description
source str File path of the processed PDF
document_type str Detected document type (e.g., "Invoice")
confidence float Classification confidence (0-1)
country_code str Detected country code (e.g., "PT")
pages list[int] Page numbers where document was found
page_range dict Start/end page range
trace_id str Unique trace identifier

License

MIT

Metadata

Release files for langchain-docdigitizer 0.2.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 langchain-docdigitizer 0.2.0
File Size Uploaded
langchain_docdigitizer-0.2.0.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-docdigitizer 0.2.0
File Interpreter ABI Platform
langchain_docdigitizer-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / langchain_docdigitizer-0.2.0.tar.gz

Download URL langchain_docdigitizer-0.2.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e85c10019d5a95ca1483ccb058522189ddcb04bce0ace17d21ea92afdf4ea4e7
BLAKE2b-256 checksum
How to use checksums
6d82c66fbcda9acc2c4353d0c68a888c444390c4852e5d27e4291a440766853c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 3, 2026.

Transparency log

Release files / langchain_docdigitizer-0.2.0-py3-none-any.whl

Download URL langchain_docdigitizer-0.2.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8354466a3156f33a952c898a3b5772f1eeaa44fe462befe8efb526e6fb13512d
BLAKE2b-256 checksum
How to use checksums
551b5ac8fcf8371c788638ecabc6e4f1a8fea1b5cfe98e3bf56d811b4885f986
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

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