Registry / serialization / pyandoc

pyandoc

JSON →
library0.2.0pypypi✓ verified 27d ago

pyandoc is an unmaintained Python wrapper for Pandoc, the universal document converter. It allows for converting text document formats by interacting with a Document object's attributes. The last release was version 0.2.0 in February 2016, and the project is no longer actively developed. Users seeking a current Pandoc wrapper for Python should consider 'pypandoc' instead.

pip install pyandoc
INSTALL
IMPORT
SIG · PYANDOC
P
pyandoc
serializationpythonv0.2.0
Install
2.4s avg
Import
25ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.026s · 19.2MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.4s · import 0.024s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Document
✓ import pandoc doc = pandoc.Document()
✗ from pyandoc import Document
The primary interaction is through a 'pandoc' module, not directly importing Document from the top-level package.

This quickstart demonstrates how to initialize a `pandoc.Document` object, assign content in Markdown, and then convert it to other formats like reStructuredText and HTML by accessing the respective properties. Ensure Pandoc is installed separately on your system for `pyandoc` to function.

import pandoc # Ensure Pandoc is installed and accessible in your system's PATH. # For example, on Ubuntu/Debian: sudo apt-get install pandoc # Or refer to Pandoc's official installation guide. # Create a Document object doc = pandoc.Document() # Assign Markdown content doc.markdown = '''# Hello from pyandoc * This is a list item * Another item with **bold** text''' # Convert to reStructuredText rst_output = doc.rst print("\n--- reStructuredText Output ---\n") print(rst_output) # Convert to HTML html_output = doc.html print("\n--- HTML Output ---\n") print(html_output)
Debug
Known issues
breakingProject is abandoned and unmaintained. pyandoc has not been updated since February 2016. It is highly likely to be incompatible with recent Python versions (3.6+) and newer Pandoc releases, leading to runtime errors or unexpected behavior.
fix
Migrate to an actively maintained Pandoc wrapper like 'pypandoc'. This library provides similar functionality and is regularly updated.
affects: 0.2.0 (all versions)
gotchaLack of direct Pandoc installation. pyandoc is just a wrapper; it does not install Pandoc itself. Users must manually install Pandoc and ensure it's available in their system's PATH for pyandoc to work. Failure to do so will result in errors when attempting conversions.
fix
Install Pandoc separately via your system's package manager (e.g., `sudo apt-get install pandoc` on Debian/Ubuntu, `brew install pandoc` on macOS) or by downloading an installer from the official Pandoc website. Verify installation by running `pandoc --version` in your terminal.
affects: 0.2.0 (all versions)
deprecatedPython 2.x compatibility. While pyandoc was released with Python 2.6-3.5 compatibility, Python 2.x is officially end-of-life. Using pyandoc in a modern Python 3 environment without legacy shims is not recommended and may cause issues.
fix
Avoid using pyandoc in Python 3.x projects. For Python 3.x, use 'pypandoc', which actively supports current Python versions and has dropped Python 2.x support.
affects: 0.2.0 (all versions)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pandoc'
The `pyandoc` library is installed via `pip install pyandoc`, but its usage pattern requires `import pandoc`. This error occurs if the `pyandoc` package itself is not installed, or if the Python environment cannot find the installed `pyandoc` package when `import pandoc` is attempted.
fix
Ensure the `pyandoc` package is correctly installed using `pip install pyandoc`. Then, use `import pandoc` as specified in the library's documentation.
OSError: You probably do not have pandoc installed.
`pyandoc` is a Python wrapper that relies on the external `pandoc` command-line utility. This error indicates that the `pandoc` executable is either not installed on your system or is not found in your system's PATH environment variable.
fix
Install the `pandoc` universal document converter directly on your operating system (e.g., via Homebrew on macOS, `apt` on Debian/Ubuntu, `choco` on Windows, or by downloading the installer from the official Pandoc website: `https://pandoc.org/installing.html`). Ensure the `pandoc` executable's location is included in your system's PATH.
AttributeError: 'Document' object has no attribute 'convert'
Unlike its successor `pypandoc` which provides a `convert()` method, `pyandoc` (version 0.2.0) primarily handles conversions by assigning source content to an input format attribute (e.g., `doc.markdown`) and retrieving the converted output from an output format attribute (e.g., `doc.rst`). Attempting to call a `convert()` method on a `pyandoc.Document` object will result in an `AttributeError`.
fix
Perform conversions by setting the source content to the appropriate input format attribute and reading the result from the desired output format attribute. For example: `doc = pandoc.Document(); doc.markdown = '# Hello'; html_output = doc.html`.
Upgrade
Version history
0.2.0latest on PyPI · released Feb 4, 2016
Audit
Dependencies
Pandocrequiredpyandoc is a wrapper and requires a separate installation of Pandoc on the system PATH.
Agent activity
9 hits · last 30 days
node
8
Resources
pyandoc — pip install pyandoc · libregistry