markitdown-converterlisted
Install: claude install-skill JZKK720/cubecloud-skills-bundle-kit
# 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.