markdown-it-pyrs
A Python interface for markdown-it.rs, using Rust for blazingly fast Markdown parsing ⚡️
What it is and what it does
markdown-it-pyrs wraps the Rust markdown-it.rs library to provide a fast Markdown parser for Python. It parses CommonMark, GitHub Flavored Markdown, and other dialects, rendering to HTML or an abstract syntax tree (Node tree). The API mirrors markdown-it-py, so existing code can often switch with minimal changes.
The main trade-off is speed for flexibility: because the parser is compiled Rust, you cannot write plugins in Python or add them dynamically at runtime. The library is currently in Beta and has no runtime dependencies beyond Python itself. It ships prebuilt wheels for modern CPython versions across common platforms, though installation requires a compatible wheel or a Rust build environment.
Use it for:
- Parse Markdown documents to HTML in performance-critical applications where speed matters more than dynamic plugin extensibility.
- Convert Markdown to an AST for programmatic inspection, transformation, or custom rendering without writing a parser.
- Enable GitHub Flavored Markdown features (tables, strikethrough, task lists) in a Python application with minimal setup.
- Migrate from markdown-it-py to a faster alternative when profiling shows Markdown parsing is a bottleneck.
- Render Markdown with built-in plugins like footnotes, front matter, or smart quotes without external dependencies.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Rust-backed Python Markdown parser that renders CommonMark, GitHub Flavored Markdown, and other dialects to HTML or AST, with a Python API compatible with markdown-it-py.
Yes, if you need fast Markdown parsing and can accept that plugins must be chosen at install time rather than added dynamically. The library is actively maintained, has no vulnerabilities, and offers a familiar API. Install friction is moderate due to compiled wheels, but prebuilt binaries cover common platforms. Not recommended if you require Python 3.8 support or dynamic plugin authorship in Python.
Install
markdown-it-pyrs on PyPI
pip
pip install markdown-it-pyrsuv
uv add markdown-it-pyrspoetry
poetry add markdown-it-pyrsInstalling markdown-it-pyrs
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for CPython 3.10–3.12 on macOS, Linux, and Windows, but no pure-Python fallback. Active maintenance with recent commits; currently in Beta status.
License in practice
Licensed under Apache 2.0 (permissive); no restrictions on commercial or private use.
Quickstart
pip install markdown-it-pyrs
from markdown_it_pyrs import MarkdownIt
md = MarkdownIt("commonmark").enable("table")
html = md.render("# Hello, world!")
node = md.tree("# Hello, world!")
Requires Python 3.9 or later; no Python 3.8 support.
Verify before relying
- Whether PyPy wheels are actually available (classifiers list PyPy but friction_evidence shows only CPython wheels).
- Current state of WASM/pyodide support mentioned as 'maybe not for long' in the description.
- Whether the 20x speed claim versus markdown-it-py holds for typical real-world documents beyond the CommonMark spec.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 661 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 122,070/month — #11,961 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: markdown_it_pyrs-0.4.0-cp310-cp310-macosx_10_12_x86_64.whl; markdown_it_pyrs-0.4.0-cp310-cp310-macosx_11_0_arm64.whl; markdown_it_pyrs-0.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; markdown_it_pyrs-0.4.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; markdown_it_pyrs-0.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; markdown_it_pyrs-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; markdown_it_pyrs-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; markdown_it_pyrs-0.4.0-cp310-none-win32.whl; markdown_it_pyrs-0.4.0-cp310-none-win_amd64.whl; markdown_it_pyrs-0.4.0-cp311-cp311-macosx_10_12_x86_64.whl; markdown_it_pyrs-0.4.0-cp311-cp311-macosx_11_0_arm64.whl; markdown_it_pyrs-0.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; markdown_it_pyrs-0.4.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; markdown_it_pyrs-0.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; markdown_it_pyrs-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; markdown_it_pyrs-0.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl; markdown_it_pyrs-0.4.0-cp311-none-win32.whl; markdown_it_pyrs-0.4.0-cp311-none-win_amd64.whl; markdown_it_pyrs-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl; markdown_it_pyrs-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Keywords: markdown, lexer, parser, commonmark, markdown-it
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
pymarkdownlntPyMarkdown is a GitHub Flavored Markdown linter…
permissive · top 5,000 on PyPI
pyromarkpyromark is a CommonMark-compliant Markdown…
unclear · top 15,000 on PyPI
comrakRenders CommonMark and GitHub Flavored Markdown…
permissive · top 15,000 on PyPI
commonmarkParses Markdown text according to the…
permissive · top 5,000 on PyPI
mistletoemistletoe is a pure-Python Markdown parser that…
permissive · top 5,000 on PyPI
py-gfmConverts GitHub-Flavored Markdown to HTML using…
permissive · top 15,000 on PyPI
multimarkConverts Markdown to HTML, LaTeX, groff man,…
permissive · top 15,000 on PyPI
markoMarko is a pure Python markdown parser that…
permissive · top 5,000 on PyPI
mdit-py-pluginsExtends markdown-it-py with a collection of…
permissive · top 1,000 on PyPI