all2md.options.outlook

Configuration options for Outlook (MSG/PST/OST) parsing.

This module defines options for parsing Microsoft Outlook format files.

class all2md.options.outlook.OutlookOptions

Bases: EmlOptions

Configuration options for Outlook-to-Markdown conversion.

This dataclass contains settings specific to Outlook format processing (MSG, PST, OST), extending EmlOptions with Outlook-specific features like folder filtering, PST/OST archive handling, and advanced message selection.

Parameters:
  • output_structure ({"flat", "hierarchical"}, default "flat") – Output structure mode: - “flat”: All messages sequentially with H1 headings - “hierarchical”: Preserve folder structure with nested headings (PST/OST only)

  • max_messages (int or None, default None) – Maximum number of messages to process. None means no limit. Useful for testing or processing large PST/OST files in chunks.

  • date_range_start (datetime.datetime or None, default None) – Only process messages sent on or after this date.

  • date_range_end (datetime.datetime or None, default None) – Only process messages sent on or before this date.

  • folder_filter (list[str] or None, default None) – For PST/OST, only process messages from these folders. Examples: [“Inbox”, “Sent Items”] None means process all folders except those in skip_folders.

  • skip_folders (list[str] or None, default None) – For PST/OST, skip messages from these folders. Default skips: [“Deleted Items”, “Junk Email”, “Trash”, “Drafts”] Set to empty list [] to process all folders.

  • include_subfolders (bool, default True) – For PST/OST, include messages from subfolders when processing a folder.

  • preserve_folder_metadata (bool, default True) – Include folder name in message metadata when using flat output structure.

Examples

Process only Inbox and Sent Items:
>>> options = OutlookOptions(folder_filter=["Inbox", "Sent Items"])
Limit to 100 most recent messages:
>>> options = OutlookOptions(max_messages=100)
Filter by date range:
>>> from datetime import datetime
>>> options = OutlookOptions(
...     date_range_start=datetime(2024, 1, 1),
...     date_range_end=datetime(2024, 12, 31)
... )
Hierarchical output with folder structure (PST/OST):
>>> options = OutlookOptions(output_structure="hierarchical")
Process all folders including deleted items:
>>> options = OutlookOptions(skip_folders=[])
output_structure: Literal['flat', 'hierarchical'] = 'flat'
max_messages: int | None = None
date_range_start: datetime | None = None
date_range_end: datetime | None = None
folder_filter: list[str] | None = None
skip_folders: list[str] | None
include_subfolders: bool = True
preserve_folder_metadata: bool = True
__init__(attachment_mode: AttachmentMode = 'alt_text', alt_text_mode: AltTextMode = 'default', attachment_output_dir: str | None = None, attachment_base_url: str | None = None, max_asset_size_bytes: int = 52428800, attachment_filename_template: str = '{stem}_{type}{seq}.{ext}', attachment_overwrite: AttachmentOverwriteMode = 'unique', attachment_deduplicate_by_hash: bool = False, attachments_footnotes_section: str | None = 'Attachments', extract_metadata: bool = False, include_headers: bool = True, preserve_thread_structure: bool = True, date_format_mode: DateFormatMode = 'strftime', date_strftime_pattern: str = '%m/%d/%y %H:%M', convert_html_to_markdown: bool = False, clean_quotes: bool = True, detect_reply_separators: bool = True, normalize_headers: bool = True, preserve_raw_headers: bool = False, clean_wrapped_urls: bool = True, url_wrappers: list[str] | None = <factory>, html_network: NetworkFetchOptions = <factory>, sort_order: EmailSortOrder = 'asc', subject_as_h1: bool = True, include_attach_section_heading: bool = True, attach_section_title: str = 'Attachments', include_html_parts: bool = True, include_plain_parts: bool = True, include_rtf_parts: bool = True, output_structure: OutputStructureMode = 'flat', max_messages: int | None = None, date_range_start: datetime.datetime | None = None, date_range_end: datetime.datetime | None = None, folder_filter: list[str] | None = None, skip_folders: list[str] | None = <factory>, include_subfolders: bool = True, preserve_folder_metadata: bool = True) None