Pandoc Documents for Python
Project Links
Meta
Author: Sébastien Boisgérault
Classifiers
Programming Language
- Python :: 3
Development Status
- 5 - Production/Stable
Topic
- Software Development
- Text Editors :: Text Processing
Pandoc (Python Library)
🚀 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.
2.4
Aug 07, 2024
2.4b0
Apr 19, 2023
2.3
Nov 23, 2022
2.2
Apr 20, 2022
2.1
Feb 16, 2022
2.0.1
Dec 04, 2021
2.0a4
Apr 05, 2020
2.0a3
Apr 05, 2020
2.0a2
Mar 28, 2020
2.0a1
Mar 28, 2020
1.1.0
Jun 28, 2021
1.0.2
Oct 08, 2017
1.0.1
Oct 08, 2017
1.0.0
Mar 22, 2014
1.0.0b3
Oct 02, 2017
1.0.0b2
Mar 24, 2016
1.0.0b1
Mar 18, 2016
1.0.0a19
Mar 18, 2016
1.0.0a18
Mar 18, 2016
1.0.0a17
Mar 17, 2016
1.0.0a16
Mar 15, 2016
1.0.0a14
Feb 19, 2016
1.0.0a13
Feb 19, 2016
1.0.0a12
Feb 14, 2016
1.0.0a8
Feb 03, 2015
1.0.0a7
Feb 03, 2015
1.0.0a6
Feb 03, 2015
1.0.0a3
1.0.0a0