{"id":1821,"library":"docling","title":"Docling Python SDK","description":"Docling is a Python SDK and CLI for parsing diverse document formats like PDF, DOCX, HTML, and more, into a unified, structured representation. It simplifies downstream workflows for generative AI applications by understanding page layouts, tables, formulas, and supporting OCR. The library is actively maintained, with frequent updates and a current version of 2.85.0.","status":"active","version":"2.85.0","language":"en","source_language":"en","source_url":"https://github.com/docling-project/docling","tags":["document parsing","pdf","docx","html","ai","generative ai","rag","ocr","document intelligence"],"install":[{"cmd":"pip install docling","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"DocumentConverter","correct":"from docling.document_converter import DocumentConverter"},{"note":"The DoclingDocument is typically accessed via the result object of a conversion.","symbol":"DoclingDocument","correct":"from docling.document import DoclingDocument"}],"quickstart":{"code":"import os\nfrom docling.document_converter import DocumentConverter\n\n# Example: Convert a document from a URL and export to Markdown\n# Docling supports local file paths, URLs, or file-like objects.\nsource_url = os.environ.get('DOCLING_EXAMPLE_URL', 'https://arxiv.org/pdf/2408.09869')\n\n# Initialize the DocumentConverter\nconverter = DocumentConverter()\n\ntry:\n    # Convert the document\n    result = converter.convert(source_url)\n\n    # Check conversion status\n    if result.status == 'SUCCESS':\n        # Access the structured document and export it to Markdown\n        markdown_output = result.document.export_to_markdown()\n        print(markdown_output[:500]) # Print first 500 characters\n        print(\"\\n... (truncated output)\")\n    else:\n        print(f\"Document conversion failed or was partial: {result.status}\")\n        # You can inspect result.input for details about the source\nexcept Exception as e:\n    print(f\"An error occurred during conversion: {e}\")","lang":"python","description":"This quickstart demonstrates how to convert a document (from a URL in this example) into a structured DoclingDocument and then export its content to Markdown format. Docling automatically detects the document type and provides a `result` object containing the `DoclingDocument`, conversion `status`, and input details."},"warnings":[{"fix":"Upgrade Python to version 3.10 or higher. For example, use Python 3.10, 3.11, or 3.12.","message":"Python 3.9 support was dropped in Docling version 2.70.0. Users on Python 3.9 or older must upgrade their Python environment.","severity":"breaking","affected_versions":">=2.70.0"},{"fix":"Access the document via `result.document`, the status via `result.status`, and input details via `result.input`.","message":"The `convert()` method returns a `result` object, not the `DoclingDocument` directly. The document, its status, and input information are encapsulated within this `result` object.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review Docling's documentation on advanced usage, resource management, and potential configurations for multi-threaded environments. Ensure proper handling of `DocumentConverter` instances and their underlying resources.","message":"Integrating Docling into multi-threaded applications may require careful resource management to avoid thread-safety issues, especially with backend resources like pypdfium, which had previous fixes related to thread-unsafe closures.","severity":"gotcha","affected_versions":"All versions (specific fix in v2.81.0, but general principle applies)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}