all2md.parsers.outlook

Outlook (MSG/PST/OST) to AST converter.

This module provides conversion from Microsoft Outlook format files to AST representation. It supports: - MSG files (single message) via extract-msg - PST/OST files (archives) via pypff (optional dependency)

For large PST/OST files, streaming processing is used to minimize memory usage.

class all2md.parsers.outlook.OutlookToAstConverter

Bases: BaseParser

Convert Microsoft Outlook files to AST representation.

This converter processes Outlook format files (MSG, PST, OST) and builds an AST that can be rendered to various markdown flavors. It supports: - MSG: Single message files via extract-msg - PST/OST: Archive files via pypff (optional dependency)

For large PST/OST files, streaming processing minimizes memory usage.

Parameters:
  • options (OutlookOptions or None) – Conversion options

  • progress_callback (ProgressCallback or None) – Optional callback for progress updates during parsing

Initialize the Outlook parser with options and progress callback.

__init__(options: OutlookOptions | None = None, progress_callback: Callable[[ProgressEvent], None] | None = None)

Initialize the Outlook parser with options and progress callback.

parse(input_data: str | Path | IO[bytes] | bytes) Document

Parse Outlook file into an AST Document.

Parameters:

input_data (str, Path, IO[bytes], or bytes) – The input Outlook file to parse. Can be: - File path (str or Path) - File-like object in binary mode - Raw file bytes

Returns:

AST Document node representing the parsed Outlook file structure

Return type:

Document

Raises:
extract_metadata(document: Any) DocumentMetadata

Extract metadata from Outlook file.

Parameters:

document (Any) – Dictionary with file information

Returns:

Extracted metadata

Return type:

DocumentMetadata