DocumentConverter base class, you can add conversion logic for any file type.
DocumentConverter Base Class
All converters inherit from theDocumentConverter abstract base class located in _base_converter.py:42.
Creating a Custom Converter
Complete Example
Here’s a complete example based on the plain text converter (converters/_plain_text_converter.py:33):
StreamInfo Object
TheStreamInfo dataclass (_stream_info.py:6) provides metadata about the file being converted:
DocumentConverterResult
TheDocumentConverterResult class (_base_converter.py:5) wraps the conversion output:
Converter Priority
When registering converters, you can specify priority to control the order they’re tried:_markitdown.py:54):
0.0-PRIORITY_SPECIFIC_FILE_FORMAT(specific converters like PDF, DOCX)10.0-PRIORITY_GENERIC_FILE_FORMAT(generic converters like HTML, plain text)
Best Practices
Next Steps
Plugin Development
Package your converter as a reusable plugin
Configuration
Learn about MarkItDown configuration options