microsoft / microsoft/markitdown
Feature Request: Support for password-protected documents (PDF, DOCX, XLSX)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 186k
- Forks
- 13.7k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 49
Description
Problem
Many business documents are password-protected for security, but MarkItDown currently fails to convert them, throwing errors instead of gracefully handling the situation.
Use Case
Users often need to process password-protected documents through automated pipelines. Currently, they must either:
- Manually remove passwords before processing
- Use external tools to strip passwords
- The tool simply fails with an unhelpful error
Proposed Solution
Add optional password parameters to the MarkItDown class and CLI:
Python API
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("protected.pdf", password="mypassword")
result = md.convert("protected.docx", password="mypassword")
result = md.convert("protected.xlsx", password="mypassword")
CLI
markitdown protected.pdf --password mypassword
markitdown protected.docx -p mypassword
Implementation Suggestions
- Add optional
passwordparameter to theconvert()method - Add
--password/-pCLI flag - For PDF: Use pypdf or PyPDF2's encryption support
- For DOCX: Use python-docx's decrypter or mammoth's options
- For XLSX: Use openpyxl's workbook encryption handling
- Return a clear error message if password is incorrect or not provided
Behavior
- If password-protected and no password provided: Show clear error message
- If wrong password: Show "incorrect password" error
- If password correct: Process normally
This would make MarkItDown much more useful in enterprise environments where document security is common.
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 reviewing the MarkItDown.convert() API and the CLI entry point described in the issue, then trace how PDF, DOCX, and XLSX conversion currently handles protected files. Done means optional passwords work through both interfaces, unprotected files still convert normally, and missing or incorrect passwords produce clear errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100