Registry / gcp / google-cloud-documentai-toolbox

google-cloud-documentai-toolbox

JSON →
library0.17.0pypypi✓ verified 79d ago

Toolbox for Google Cloud Document AI: a Python library providing utilities to simplify working with Document AI processors, including splitting documents, converting between formats, and extracting entities. Current version 0.15.2, requires Python >=3.9. Maintained by Google, part of the google-cloud-python monorepo.

pip install google-cloud-documentai-toolbox
INSTALL
IMPORT
SIG · GOOGLE-CLOUD-DOCUM
G
google-cloud-documentai-toolbox
gcppythonv0.17.0
Install
25.0s avg
Import
Disk
636MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.17.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 25.0s · import 0.000s · 623MB
636MB installed
● package 636MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Document
from google.cloud.documentai_toolbox.wrappers.document import Document
from documentai_toolbox.wrappers.document import Document

Process a document with Document AI and wrap the result using the toolbox Document wrapper.

import os from google.cloud import documentai from documentai_toolbox.wrappers.document import Document project_id = os.environ.get('GOOGLE_CLOUD_PROJECT', '') location = 'us' processor_id = os.environ.get('PROCESSOR_ID', '') file_path = 'invoice.pdf' # Initialize client client = documentai.DocumentProcessorServiceClient() name = client.processor_path(project_id, location, processor_id) # Read file with open(file_path, 'rb') as f: content = f.read() # Process document request = documentai.ProcessRequest(name=name, raw_document={'content': content, 'mime_type': 'application/pdf'}) result = client.process_document(request=request) # Wrap the Document AI Document object doc = Document(result.document) print(f"Entities: {doc.entities}")
Debug
Known issues
gotchaThe toolbox does not inherit from google.cloud.documentai.Document; it wraps it. Always use `documentai_toolbox.wrappers.document.Document` to wrap a protobuf Document object.
fix
from documentai_toolbox.wrappers.document import Document; doc = Document(ai_document)
affects: all
deprecatedPython 3.9 support is deprecated in the google-cloud-python ecosystem. Future versions may drop 3.9 support.
fix
Upgrade to Python 3.10 or later.
affects: >=0.15.2
gotchaThe toolbox is not installed automatically with google-cloud-documentai. Must be installed separately.
fix
pip install google-cloud-documentai-toolbox
affects: all
Upgrade
Version history
0.17.0latest on PyPI · released Jun 3, 2026
Audit
Dependencies
google-cloud-documentairequiredCore dependency for Document AI client
Agent activity
28 hits · last 30 days
node
24
OpenAI (training)
1
Resources
google-cloud-documentai-toolbox — pip install google-cloud-documentai-toolbox · libregistry