Skip to content

API Reference parrot.interfaces.doc_converter

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.interfaces.doc_converter

View source

DocumentConverterInterface - Helper for document conversion via Docling.

Class DocumentConverterInterface

Wraps Docling's DocumentConverter with async support and configurable options.

Parameter Type Default Description
do_ocr bool False
use_tesseract bool False
do_table_structure bool True
do_cell_matching bool True
artifacts_path Optional[str] None
max_num_pages int 100
max_file_size int 20971520

Method DocumentConverterInterface.convert

Convert a document source to the requested output format.

convert(source: Union[str, Path], *, output_format: str = 'markdown', max_num_pages: Optional[int] = None, max_file_size: Optional[int] = None) -> Union[str, Dict[str, Any]]

Parameter Type Default Description
source Union[str, Path] Local path or URL to the document.
output_format str 'markdown' "markdown" or "json".
max_num_pages Optional[int] None Override for page limit.
max_file_size Optional[int] None Override for file-size limit (bytes).

Returns: Union[str, Dict[str, Any]] — Markdown string when output_format is "markdown", JSON-serializable dict when "json".

Method DocumentConverterInterface.convert_to_markdown

Convenience wrapper returning markdown.

convert_to_markdown(source: Union[str, Path], **kwargs) -> str

Parameter Type Default Description
source Union[str, Path]
**kwargs {}

Returns: str

Method DocumentConverterInterface.convert_to_json

Convenience wrapper returning a JSON-serializable dict.

convert_to_json(source: Union[str, Path], **kwargs) -> Dict[str, Any]

Parameter Type Default Description
source Union[str, Path]
**kwargs {}

Returns: Dict[str, Any]

Attribute SUPPORTED_EXTENSIONS

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally