Files
deepset-ai--haystack/docs-website/reference_versioned_docs/version-2.30/integrations-api/markitdown.md
T
wehub-resource-sync c56bef871b
Sync docs with Docusaurus / sync (push) Waiting to run
Tests / Check if changed (push) Waiting to run
Tests / format (push) Blocked by required conditions
Tests / check-imports (push) Blocked by required conditions
Tests / Unit / macos-latest (push) Blocked by required conditions
Tests / Unit / ubuntu-latest (push) Blocked by required conditions
Tests / Unit / windows-latest (push) Blocked by required conditions
Tests / mypy (push) Blocked by required conditions
Tests / Integration / ubuntu-latest (push) Blocked by required conditions
Tests / Integration / macos-latest (push) Blocked by required conditions
Tests / Integration / windows-latest (push) Blocked by required conditions
Tests / notify-slack-on-failure (push) Blocked by required conditions
Tests / Mark tests as completed (push) Blocked by required conditions
Docker image release / Build base image (push) Waiting to run
CodeQL / Analyze (python) (push) Has been cancelled
Update Platform Components Table / update (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:22:28 +08:00

1.8 KiB
Raw Blame History

title, id, description, slug
title id description slug
Markitdown integrations-markitdown Markitdown integration for Haystack /integrations-markitdown

haystack_integrations.components.converters.markitdown.markitdown_converter

MarkItDownConverter

Converts files to Haystack Documents using MarkItDown.

MarkItDown is a Microsoft library that converts many file formats to Markdown, including PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx), HTML, images, audio, and more. All processing is performed locally.

Usage example

from haystack_integrations.components.converters.markitdown import MarkItDownConverter

converter = MarkItDownConverter()
result = converter.run(sources=["document.pdf", "report.docx"])
documents = result["documents"]

init

__init__(store_full_path: bool = False) -> None

Initializes the MarkItDownConverter.

Parameters:

  • store_full_path (bool) If True, the full file path is stored in the Document metadata. If False, only the file name is stored. Defaults to False.

run

run(
    sources: list[str | Path | ByteStream],
    meta: dict[str, Any] | list[dict[str, Any]] | None = None,
) -> dict[str, list[Document]]

Converts files to Documents using MarkItDown.

Parameters:

  • sources (list[str | Path | ByteStream]) List of file paths or ByteStream objects to convert.
  • meta (dict[str, Any] | list[dict[str, Any]] | None) Optional metadata to attach to the Documents. Can be a single dict applied to all Documents, or a list of dicts aligned with sources.

Returns:

  • dict[str, list[Document]] A dictionary with key documents containing the converted Documents.