Skip to content
Skills Library
Programming · Building & coding

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.

Licence
MIT
Last repository change
12.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.

Licence

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

  1. Quick Reference
  2. Optional Dependencies Pattern
  3. HTML-as-Intermediate Pattern
  4. Testing
Original SKILL.md headings · 118 lines, 323 words
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

: harmful content, incorrect descriptions or an author’s removal request.

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.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.