FastAPI service for extracting text from PDF, DOCX, PPTX, EPUB, HTML, TXT with multi-backend architecture.
- Multiple file formats: Supports PDF, DOCX, PPTX, EPUB, HTML, Markdown, TXT, CSV, and more
- Vision LLM: Optional OpenAI-compatible API for extracting text from scanned PDFs/images
- Page-wise output: Returns structured output (one per page/slide)
- Extensible backend architecture: Designed for easy addition of new backends
pip install -e .markitdown supports these file types out of the box:
| Format | MIME Type |
|---|---|
application/pdf |
|
| DOCX | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| PPTX | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| EPUB | application/epub+zip |
| HTML | text/html |
| Markdown | text/markdown or text/x-markdown |
| TXT | text/plain |
| CSV | text/csv |
| DOC (legacy) | application/msword |
| PPT (legacy) | application/vnd.ms-powerpoint |
| XLSX | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| XLS (legacy) | application/vnd.ms-excel |
Vision mode is configured in backends.ini under the [llm] section:
[llm]
# Set these values to enable vision/OCR mode
token = your_api_key # OpenAI or compatible API key
model = gpt-4o # Model name (supports vision)
url = https://api.openai.com/v1 # API endpointTo enable vision mode:
- Open
backends.ini - Uncomment and set the
[llm]section values - Restart the server
Example with local Ollama:
[llm]
token = ollama
model = llava
url = http://localhost:11434/v1Leave [llm] empty to disable vision mode (uses markitdown without LLM).
python deadsimple/main.pyAPI available at http://localhost:5000
curl -X POST http://localhost:5000/process \
-H "Content-Type: application/pdf" \
--data-binary @document.pdfResponse:
{
"page_content": "page 1 text\n---\npagina 2 text",
"metadata": {}
}pytest tests/The service supports optional backends that provide extra capabilities such as OCR, document linking, and content analysis. These backends are not required for basic operation; markitdown is always included.
Available backends
ocrflux– OCR extraction backenddoclings– Document linking backenddocstrange– Specialized document processing backendmarker– Marker based backend
Installation
Each backend is provided as an extra in pyproject.toml. Install the desired backend with pip, for example:
pip install -e ".[ocrflux]"
pip install -e ".[doclings]"
pip install -e ".[docstrange]"
pip install -e ".[marker]"You can also install multiple extras at once:
pip install -e ".[ocrflux,doclings,docstrange,marker]"