panflute
Pythonic Pandoc filters
Decision gist · record as of 2026-08-14
Yes, if you need to programmatically transform documents via Pandoc and want to avoid writing raw JSON filters. Install friction is low and the license is permissive. Be aware that the package has not been released in 877 days; check that your Pandoc version (2.11.0.4–3.1.x for version 2.3.1) is compatible before committing to it for production workflows.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a compatible Pandoc installation on the system; panflute 2.3.1 supports Pandoc 2.11.0.4–3.1.x and Pandoc API versions 1.22–1.23.
- Low friction installation with only two runtime dependencies (click and pyyaml).
- The package is in production/stable status but has not been released for 877 days; the repository remains active with recent commits, though maintenance appears infrequent.
License · maintenance · safety
BSD3 (permissive) — BSD3 license is permissive and poses no restrictions on commercial or private use, modification, or redistribution as long as the license text is included.
last release 2024-03-20 (877 days) · last repo commit 2026-02-06 · 555 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 169,668 downloads/mo, #10,411 on PyPI
Alternatives
Verify before relying
pip install panflute
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Str):
return pf.Str(elem.text.upper())
if __name__ == '__main__':
pf.run_filter(action)- Whether the 877-day gap since last release indicates active maintenance or dormancy relative to Pandoc's release cycle.
- Performance characteristics when processing large documents or complex filter chains.
- Compatibility with PyPy in practice, given the classifier indicates support but no runtime evidence is provided.
What it is and what it does
Panflute is a Python wrapper around Pandoc's document processing pipeline that lets you write filters by manipulating document elements as Python objects rather than working directly with JSON. It depends on click for CLI handling and pyyaml for configuration, and requires a matching Pandoc binary installed on your system to function.
You write a filter function that receives document elements (paragraphs, text, code blocks, etc.) and returns transformed versions of them. Panflute handles the marshalling between Pandoc's JSON representation and Python objects, so you work with readable class instances instead of raw data structures. This is most useful when you need to customize how Pandoc converts between formats—for example, rewriting links, injecting metadata, or applying domain-specific transformations to code blocks.
Use it for
- Rewrite internal document links or citations during Markdown-to-HTML conversion for a static site generator.
- Transform code blocks with custom syntax into formatted output (e.g., mermaid diagrams to SVG).
- Inject metadata or styling directives into LaTeX output for academic papers written in Markdown.
- Strip or modify elements (images, scripts, comments) when converting documents for different audiences.
- Automate document preprocessing for research workflows that combine Markdown, Pandoc, and custom logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to programmatically transform documents via Pandoc and want to avoid writing raw JSON filters.
Install friction is low and the license is permissive. Be aware that the package has not been released in 877 days; check that your Pandoc version (2.11.0.4–3.1.x for version 2.3.1) is compatible before committing to it for production workflows.
Install
panflute on PyPI
Before you install
Low friction installation with only two runtime dependencies (click and pyyaml). The package is in production/stable status but has not been released for 877 days; the repository remains active with recent commits, though maintenance appears infrequent.
Requires a compatible Pandoc installation on the system; panflute 2.3.1 supports Pandoc 2.11.0.4–3.1.x and Pandoc API versions 1.22–1.23.
License in practice
BSD3 license is permissive and poses no restrictions on commercial or private use, modification, or redistribution as long as the license text is included.
Quickstart
pip install panflute
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Str):
return pf.Str(elem.text.upper())
if __name__ == '__main__':
pf.run_filter(action)
Verify before relying
- Whether the 877-day gap since last release indicates active maintenance or dormancy relative to Pandoc's release cycle.
- Performance characteristics when processing large documents or complex filter chains.
- Compatibility with PyPy in practice, given the classifier indicates support but no runtime evidence is provided.
Package facts
| License | BSD3 permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesclickpyyaml |
| Maintenance | Aging 877 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 169,668 / month, #10,411 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: End Users/DesktopLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Build ToolsTopic :: Text Processing :: Filters |
Evidence: panflute-2.3.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “document transformation markdown”
- panflutePanflute provides a Pythonic interface for writing Pandoc filters,…
- pandocPandoc Python Library wraps the Pandoc document model to analyze,…
- pandocfiltersProvides Python utilities for writing pandoc filters that transform…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also pandocfilters · pandoc · pypandoc · pyandoc · pypandoc-binary · Markdown · setuptools-markdown · markdown2 · mistletoe · m2r2