microsoft / microsoft/markitdown
No way to disable specific built-in converters without subclassing
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 186k
- Forks
- 13.7k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 49
Description
Problem
When you call MarkItDown(), all built-in converters are registered. There is no way to exclude specific converters without subclassing MarkItDown and overriding enable_builtins.
This creates friction in two common cases:
-
Security hardening. A deployment that serves untrusted files might want to disable
ZipConverter(to prevent zip bombs even with the existing limits) orAudioConverter(to avoid network calls to Whisper APIs on untrusted audio files). Right now this requires a custom subclass. -
Dependency management. Some converters require optional extras (
mammothfor DOCX,pptxfor PowerPoint,speech_recognitionfor audio). If a user installsmarkitdownwithout those extras, the converter registration silently does nothing. A user who wants to explicitly opt in to only a specific set of converters has no clean way to do that.
Proposed API
# Option A: exclusion list
md = MarkItDown(disabled_converters=["ZipConverter", "AudioConverter"])
# Option B: explicit inclusion (no built-ins except what you list)
md = MarkItDown(enable_builtins=False)
md.register_converter(PdfConverter())
md.register_converter(HtmlConverter())
# Option B already partially works - enable_builtins=False would just skip the auto-registration
Option A is the lower-friction change. The enable_builtins method could accept an exclude parameter:
def enable_builtins(self, md: "MarkItDown", exclude: list[str] | None = None) -> None:
...
Notes
- This is purely an API surface change with no impact on converter logic
- The
excludelist could match on class name strings to avoid importing converter classes just to exclude them
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the MarkItDown constructor and its enable_builtins entry point to understand how built-in converters are registered. Add the proposed way to exclude named converters while preserving current default registration, then verify that excluded converters are not registered and existing behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100