skillfed

pypandoc

Thin wrapper for pandoc.

pypandoc v1.17 8.8M downloads/30d#1,594 on PyPI1,151
Permissive license MIT Active released

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 pypandoc

uv

uv add pypandoc

poetry

poetry add pypandoc

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Text ProcessingTopic :: Text Processing :: Filters

Tags

document format conversionmarkdown to html converterpandoc python wrapperconvert docx to pdfdocument file conversion library
document-conversionpandoc-wrapper

More Text Processing packages