markitdown-converter
/markitdown-converter
Create a new MarkItDown converter or plugin. Use when: adding a new file format converter, creating a plugin package, registering converters via entry points, or understanding the converter interface. Covers DocumentConverter subclass, accepts/convert pattern, plugin registration, pyproject.toml entry points, and priority system.
- Author
- JZKK720 ↗
- Repository
- cubecloud-skills-bundle-kit ↗
- Licence
- MIT
- Last repository change
- 12.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Create a new MarkItDown converter or plugin. Use when: adding a new file format converter, creating a plugin package, registering converters via entry points, or understanding the converter interface. Covers DocumentConverter subclass, accepts/convert pattern, plugin registration, pyproject.toml entry points, and priority system.
Original author description
Create a new MarkItDown converter or plugin. Use when: adding a new file format converter, creating a plugin package, registering converters via entry points, or understanding the converter interface. Covers DocumentConverter subclass, accepts/convert pattern, plugin registration, pyproject.toml entry points, and priority system.
How it works
- Quick Reference
- Optional Dependencies Pattern
- HTML-as-Intermediate Pattern
- Testing
SKILL.md preview
---
name: markitdown-converter
description: "Create a new MarkItDown converter or plugin. Use when: adding a new file format converter, creating a plugin package, registering converters via entry points, or understanding the converter interface. Covers DocumentConverter subclass, accepts/convert pattern, plugin registration, pyproject.toml entry points, and priority system."
---
# MarkItDown Converter/Plugin Creation
## Quick Reference
### Converter Interface
```python
from markitdown import DocumentConverter, DocumentConverterResult, StreamInfo
class MyConverter(DocumentConverter):
ACCEPTED_MIME_TYPE_PREFIXES = ["application/vnd.myformat"]
ACCEPTED_FILE_EXTENSIONS = [".myf"]
def accepts(self, file_stream: BinaryIO, stream_info: StreamInfo, **kwargs) -> bool:
# Check extension first (exact match), then MIME type prefix
# MUST NOT change stream position — seek back if you read
extension = (stream_info.extension or "").lower()
if extension in self.ACCEPTED_FILE_EXTENSIONS:
return True
mimetype = (stream_info.mimetype or "").lower()
return any(mimetype.startswith(p) for p in self.ACCEPTED_MIME_TYPE_PREFIXES)
def convert(self, file_stream: BinaryIO, stream_info: StreamInfo, **kwargs) -> DocumentConverterResult:
# Read the stream and produce Markdown
content = file_stream.read()
markdown = self._do_conversion(content)
return DocumentConverterResult(markdown=markdown)
```
### Plugin Package Structure
```
packages/markitdown-myplugin/
├── pyproject.toml
└── src/
└── markitdown_myplugin/
├── __init__.py
├── __about__.py
├── _plugin.py # register_converters() + converter class(es)
└── py.typed
```
### pyproject.toml (plugin)
```toml
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "markitdown-myplugin"
dynamic = ["version"]
requires-python = ">=3.10"
dependencies = ["markitdown>=0.1.0"]
[project.entry-points."markitdown.plugin"]
myplugin = "markitdown_myplugin"
[tool.hatch.version]
path = "src/markitdown_myplugin/__about__.py"
```
### _plugin.py Template
```python
__plugin_interface_version__ = 1
def register_converters(markitdown: MarkItDown, **kwargs):
markitdown.register_converter(MyConverter())
```
### Priority System
| Constant | Value | Use Case |
|---|---|---|
| `PRIORITY_SPECIFIC_FILE_FORMAT` | `0.0` | Default for format-specific converters |
| `PRIORITY_GENERIC_FILE_FORMAT` | `10.0` | Catch-all (PlainText, HTML, ZIP) |
| Custom (e.g., OCR) | `-1.0` | Replace built-in converters |
Lower = tried first. Use `markitdown.register_converter(converter, priority=N)`.
## Optional Dependencies Pattern
```python
_dependency_exc_info = None
try:
import some_package
except ImportError:
_dependency_exc_info = sys.exc_info()
# In convert():
if _dependency_exc_info is not None:
raise MissingDependencyException(
"some_package", "pip install markitdown[myfeature]"
) from _dependency_exc_info[1]
```
## HTML-as-Intermediate Pattern
For formats that have an HTML representation, convert to HTML first, then use `_CustomMarkdownify`:
```python
from markitdown.converters import HtmlConverter
class MyConverter(DocumentConverter):
def convert(self, file_stream, stream_info, **kwargs):
html = self._extract_html(file_stream)
return HtmlConverter().convert_string(html, **kwargs)
```
## Testing
- Test files go in `packages/<pkg>/tests/test_files/`
- Expected outputs in `test_files/expected_outputs/`
- Use `FileTestVector` for parametrized tests
- See `packages/markitdown-sample-plugin/tests/` for a minimal plugin test example
Versions
The database has no other skills named markitdown-converter.
Database snapshot: 13.11.2026 · package version 917f4a218d75 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 100markitdown-testing
Write and run tests for MarkItDown converters. Use when: adding tests for a new converter, writing parametrized test vectors, running pytest with hatch, understanding FileTestVector pattern, or debugging test failures. Covers test file layout, FileTestVector dataclass,… - 100python-packaging
Python package creation and PyPI distribution via pyproject.toml and entry points. Use when publishing a package or setting up build configuration. - 84make-wpf-converter
Generates WPF IValueConverter or IMultiValueConverter classes with MarkupExtension pattern. Use when creating a new value converter, scaffolding a MultiValueConverter, or adding a converter with direct XAML usage. Usage: /wpf-dev-pack:make-wpf-converter <ConverterName> [multi] - 100file-format-converter
Convert file format converter operations. Auto-activating skill for Data Pipelines. Triggers on: file format converter, file format converter Part of the Data Pipelines skill category. Use when working with file format converter functionality. Trigger with phrases like "file… - 100pyproject-generator
Use when creating or standardizing pyproject.toml for a Python library, service, MCP server or Electron backend. - 90markitdown
Convert PDF, Office, HTML, image, audio and other files, URLs, or stdin streams to Markdown with the dsh-markitdown plugin (Microsoft MarkItDown). Use when the user asks to extract text or tables from a document, convert a file or YouTube link to Markdown, or make an attachment readable.