docs: add pypandoc to File Format Processing intro

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-10-16 18:37:49 +08:00
co-authored by Claude
parent ca9dcd2fee
commit c63397f8d6
@@ -6,6 +6,7 @@ How to choose:
- ELF binaries and DWARF debug info: pyelftools
- A table you import or export as CSV, JSON, YAML, or Excel: Tablib
- Documents turned into Markdown for an LLM: MarkItDown, or Docling for complex layouts and scans
- Documents converted between Markdown, Word, LaTeX, and HTML: pypandoc
- Excel: openpyxl to edit a workbook, XlsxWriter to create one with charts and formatting
- Word documents: python-docx
- PowerPoint decks: python-pptx
@@ -25,6 +26,8 @@ MarkItDown converts PDF, Word, Excel, PowerPoint, HTML, and more into Markdown [
Docling is for documents where layout matters: it [understands page layout, reading order, and tables, and runs OCR](https://docling-project.github.io/docling/) on scanned PDFs. It converts each file into a `DoclingDocument`, which you export to Markdown.
pypandoc wraps pandoc, which [converts between Markdown, Word, LaTeX, HTML, and many other formats](https://pandoc.org/) in both directions. It needs pandoc on your machine, and the [`pypandoc_binary` package](https://github.com/JessicaTegner/pypandoc#installation) includes it. Pass a path to `convert_file()`, or a string and its `format` to `convert_text()`. For output formats like DOCX and EPUB, [pass an `outputfile`](https://github.com/JessicaTegner/pypandoc#usage), since that's the only way to convert to them.
openpyxl reads and writes Excel workbooks, so it's the one to use when the file already exists. Install defusedxml when you open spreadsheets from other people, since openpyxl [doesn't guard against XML attacks](https://openpyxl.readthedocs.io/en/stable/#security) by default.
XlsxWriter [can't read or modify existing files](https://xlsxwriter.readthedocs.io/introduction.html). In return, it supports more Excel features than the alternatives, and its files are close to what Excel itself writes.