Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
December 4, 2022 11:01
April 19, 2023 11:10
April 4, 2020 15:43
October 6, 2021 17:51
April 19, 2023 11:09
November 29, 2021 11:47

Pandoc (Python Library)

Python PyPI version Mkdocs GitHub discussions Downloads GitHub stars

linux macos windows

πŸš€ Getting started

Install Pandoc first, for example with conda:

$ conda install -c conda-forge pandoc

Then, install the Pandoc Python Library with pip:

$ pip install --upgrade pandoc

🌌 Overview

Pandoc is the awesome open-source command-line tool that converts documents from one format to another. The project was initiated by John MacFarlane; under the hood, it's a Haskell library.

The Pandoc Python Library brings Pandoc's document model to Python:

$ echo "Hello world!" | python -m pandoc read 
Pandoc(Meta({}), [Para([Str('Hello'), Space(), Str('world!')])])

It can be used to analyze, create and transform documents, in Python:

>>> import pandoc
>>> text = "Hello world!"
>>> doc =
>>> doc
Pandoc(Meta({}), [Para([Str('Hello'), Space(), Str('world!')])])

>>> paragraph = doc[1][0]
>>> paragraph
Para([Str('Hello'), Space(), Str('world!')])
>>> from pandoc.types import Str
>>> paragraph[0][2] = Str('Python!')
>>> text = pandoc.write(doc)
>>> print(text)
Hello Python!

For more information, refer to the πŸ“– documentation.