Basic Configuration
Create a MarkItDown instance with optional configuration:Constructor Parameters
TheMarkItDown class (_markitdown.py:93) accepts the following parameters:
Core Parameters
bool
default:"True"
Enable built-in converters for PDF, DOCX, XLSX, HTML, and other formats. Set to
False to disable all built-ins.bool
default:"False"
Enable third-party plugin converters. Plugins must be installed and will be discovered via entry points.
requests.Session
default:"None"
Custom
requests.Session for HTTP operations. If not provided, MarkItDown creates a session with markdown preference headers.LLM Integration
Configure LLM services for enhanced conversion (e.g., image captioning):Any
default:"None"
LLM client instance for generating descriptions. Compatible with OpenAI client or similar interfaces.
str
default:"None"
Model name/identifier to use with the LLM client (e.g.,
"gpt-4-vision-preview").str
default:"None"
Custom prompt template for LLM requests. Used by converters that support LLM-based processing.
Converter Options
str
default:"None"
Path to the
exiftool binary for extracting image metadata. If not specified, MarkItDown searches common system paths and the EXIFTOOL_PATH environment variable.str
default:"None"
Custom style map for DOCX conversion. Defines how Word styles map to Markdown formatting.
Document Intelligence
Configure Azure Document Intelligence for advanced document processing:str
default:"None"
Azure Document Intelligence endpoint URL. When provided, enables the Document Intelligence converter.
Any
default:"None"
Azure credential for Document Intelligence authentication.
list
default:"None"
List of file types to process with Document Intelligence.
str
default:"None"
API version for Document Intelligence service.
Configuration Examples
Basic Usage with Defaults
With LLM Integration
Enable AI-powered image captioning:With Custom Requests Session
Use a custom session for proxy, authentication, or custom headers:With Plugins Enabled
Custom Converters Only
Disable built-ins and register only your custom converters:With Azure Document Intelligence
With Custom DOCX Styling
Control how Word styles map to Markdown:With Custom ExifTool Path
Dynamic Configuration
Enabling Built-ins After Creation
If you initially disable built-ins, you can enable them later:Enabling Plugins After Creation
Per-Conversion Options
You can pass additional options to specific conversions:Environment Variables
MarkItDown checks the following environment variables:EXIFTOOL_PATH
Specify the path to theexiftool binary:
exiftool_pathconstructor parameterEXIFTOOL_PATHenvironment variable- Common system paths:
/usr/bin/usr/local/bin/opt/bin/opt/local/bin/opt/homebrew/binC:\Windows\System32C:\Program FilesC:\Program Files (x86)
Converter Registration
Manually register converters with custom priority:Default Requests Session
If norequests_session is provided, MarkItDown creates one with these headers (_markitdown.py:110):
Configuration Object Pattern
For complex setups, use a configuration object:Best Practices
Next Steps
Custom Converters
Create your own document converters
Plugin Development
Build and distribute MarkItDown plugins