pypandoc
Thin wrapper for pandoc.
What it is and what it does
Pypandoc is a thin Python wrapper around pandoc, the widely-used universal document converter. It lets you call pandoc's conversion capabilities directly from Python code without shelling out or managing subprocess calls yourself. You can convert between dozens of document formats—Markdown, HTML, DOCX, PDF, reStructuredText, EPUB, and many others—by passing input as files, file patterns, or strings, and optionally writing output to a file.
The package has no Python runtime dependencies and installs as a pure wheel, making it lightweight to add to any project. Pandoc itself must be available on your system (either pre-installed or via the companion pypandoc_binary package), but pypandoc handles locating it automatically or via an environment variable. It supports modern Python versions (3.7 through 3.15) and has been actively maintained since 2011.
Use it for:
- Convert Markdown documentation to HTML or DOCX for sharing with non-technical stakeholders
- Batch-convert multiple document files from one format to another in an automated pipeline
- Generate PDF reports from Markdown templates in a web application or data processing workflow
- Transform reStructuredText to HTML as part of a documentation build system
- Apply pandoc filters (like pandoc-citeproc) to add citations or other processing to converted documents
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pypandoc wraps pandoc, a universal document converter, letting you convert between document formats (Markdown, HTML, DOCX, PDF, and many others) from Python code.
Yes. Pypandoc is a stable, actively maintained wrapper with no Python dependencies, permissive licensing, and broad platform support. Install it if you need to convert between document formats from Python code. The only gotcha is that pandoc itself must be available on your system—either pre-installed or via the pypandoc_binary companion package.
Install
pypandoc on PyPI
pip
pip install pypandocuv
uv add pypandocpoetry
poetry add pypandocInstalling pypandoc
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits and a stable release history since 2011. Supports Python 3.7 through 3.15.
License in practice
MIT license (permissive): you can use, modify, and distribute pypandoc freely in commercial and private projects with minimal restrictions.
Quickstart
pip install pypandoc
import pypandoc
# Convert Markdown file to reStructuredText
output = pypandoc.convert_file('somefile.md', 'rst')
# Or convert a string
output = pypandoc.convert_text('# Title', 'html', format='md')
Pandoc must be installed separately on your system (or use pypandoc_binary package which includes it). Set PYPANDOC_PANDOC environment variable if pandoc is not in PATH.
Verify before relying
- Performance characteristics when converting large files or batch operations
- Compatibility with all pandoc output formats (odt, docx, epub, pdf) on all supported platforms
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 153 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,787,688/month — #1,594 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pypandoc-1.17-py3-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
pyandocPyandoc wraps Pandoc to convert between…
permissive · top 5,000 on PyPI
pypandoc-binarypypandoc_binary wraps pandoc, a universal…
permissive · top 5,000 on PyPI
panflutePanflute provides a Pythonic interface for…
permissive · top 15,000 on PyPI
pandocPandoc Python Library wraps the Pandoc document…
permissive · top 15,000 on PyPI
pandocfiltersProvides Python utilities for writing pandoc…
permissive · top 1,000 on PyPI
PyLaTeXPyLaTeX generates LaTeX documents and code…
permissive · top 15,000 on PyPI
markitdownConverts various file formats (PDF, Excel,…
permissive · top 5,000 on PyPI
doclingDocling parses diverse document formats—PDF,…
permissive · top 5,000 on PyPI
setuptools-markdownConverts Markdown files to reStructuredText…
permissive · top 15,000 on PyPI
docx2pdfConverts DOCX files to PDF on Windows or macOS…
permissive · top 5,000 on PyPI