Skip to main content

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 = pandoc.read(text)
>>> 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.

Release files for pandoc 2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pandoc 2.4
File Size Uploaded
pandoc-2.4.tar.gz 34.6 kB Details

Release files / pandoc-2.4.tar.gz

Download URL pandoc-2.4.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ecd1f8cbb7f4180c6b5db4a17a7c1a74df519995f5f186ef81ce72a9cbd0dd9a
BLAKE2b-256 checksum
How to use checksums
109ae3186e760c57ee5f1c27ea5cea577a0ff9abfca51eefcb4d9a4cd39aff2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page