{"id":23802,"library":"google-cloud-documentai-toolbox","title":"Google Cloud Document AI Toolbox","description":"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.","status":"active","version":"0.15.2","language":"python","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-documentai-toolbox","tags":["google-cloud","document-ai","toolbox","document-processing","ocr"],"install":[{"cmd":"pip install google-cloud-documentai-toolbox","lang":"bash","label":"default"}],"dependencies":[{"reason":"Core dependency for Document AI client","package":"google-cloud-documentai","optional":false}],"imports":[{"note":"Wrong top-level import path; the toolbox is not part of google.cloud namespace.","wrong":"from google.cloud.documentai_toolbox import Document","symbol":"Document","correct":"from documentai_toolbox.wrappers.document import Document"}],"quickstart":{"code":"import os\nfrom google.cloud import documentai\nfrom documentai_toolbox.wrappers.document import Document\n\nproject_id = os.environ.get('GOOGLE_CLOUD_PROJECT', '')\nlocation = 'us'\nprocessor_id = os.environ.get('PROCESSOR_ID', '')\nfile_path = 'invoice.pdf'\n\n# Initialize client\nclient = documentai.DocumentProcessorServiceClient()\nname = client.processor_path(project_id, location, processor_id)\n\n# Read file\nwith open(file_path, 'rb') as f:\n    content = f.read()\n\n# Process document\nrequest = documentai.ProcessRequest(name=name, raw_document={'content': content, 'mime_type': 'application/pdf'})\nresult = client.process_document(request=request)\n\n# Wrap the Document AI Document object\ndoc = Document(result.document)\nprint(f\"Entities: {doc.entities}\")","lang":"python","description":"Process a document with Document AI and wrap the result using the toolbox Document wrapper."},"warnings":[{"fix":"from documentai_toolbox.wrappers.document import Document; doc = Document(ai_document)","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to Python 3.10 or later.","message":"Python 3.9 support is deprecated in the google-cloud-python ecosystem. Future versions may drop 3.9 support.","severity":"deprecated","affected_versions":">=0.15.2"},{"fix":"pip install google-cloud-documentai-toolbox","message":"The toolbox is not installed automatically with google-cloud-documentai. Must be installed separately.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install google-cloud-documentai-toolbox","cause":"Toolbox not installed.","error":"ModuleNotFoundError: No module named 'documentai_toolbox'"},{"fix":"Use: from documentai_toolbox.wrappers.document import Document","cause":"Trying to import Document from the wrong namespace.","error":"AttributeError: module 'google.cloud.documentai_toolbox' has no attribute 'Document'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}