Skip to content

v25.4.0

Choose a tag to compare

@muhammadumargroupdocs muhammadumargroupdocs released this 25 Apr 14:45
· 10 commits to main since this release
e8f399d

Summary

This release introduces directory input support, allowing users to convert all supported document files in a folder to Markdown with a single command. The CLI now accepts either a single file or a directory, and outputs the converted content to a specified folder. This makes batch processing easier and more efficient.

New Features

  • Directory input support: Pass --input-dir to convert all supported files (.docx, .pdf, .pptx, .xlsx) in a folder.
  • Still supports single file input with --input-file.
  • --output-dir is mandatory to ensure output files are saved consistently.
  • --insert-into-llm works in both modes (optional).
  • Output directory is auto-created if missing.
  • Programmatic API support: Use MarkItDown directly in your Python code.

CLI Usage Examples

Convert a single file

python main.py --input-file ./example.docx --output-dir ./markdowns

Convert an entire folder

python main.py --input-dir ./documents --output-dir ./markdowns

Convert all files and insert into LLM

python main.py --input-dir ./data --output-dir ./md --insert-into-llm

API Usage (Python Code)

Convert a single file

from markitdown import MarkItDown

converter = MarkItDown(output_dir="./markdowns")
converter.convert_document(input_path="./test.docx", insert_into_llm=False)

Convert an entire folder

from markitdown import MarkItDown

converter = MarkItDown(output_dir="./markdowns")
converter.convert_directory(input_dir="./documents", insert_into_llm=True)

Notes

  • Supported extensions: .docx, .pdf, .pptx, .xlsx
  • If using Aspose APIs, you may be prompted to apply your license file.
  • LLM features require setting OPENAI_API_KEY and optionally OPENAI_MODEL as environment variables.