comrak
Python bindings for the Comrak Rust library, a fast CommonMark/GFM parser
What it is and what it does
Comrak is a Python wrapper around the Comrak Rust library, exposing a fast CommonMark and GitHub Flavored Markdown parser. It offers two main rendering modes: `render_markdown()` for HTML output and `render_commonmark()` for normalized CommonMark text. The package exposes the full option surface of the underlying Rust library—Extension, Parse, and Render options—allowing fine-grained control over parsing behavior and output formatting, including support for alerts, shortcodes, and list style customization.
The binding has no runtime dependencies and ships with prebuilt wheels for modern Python versions (3.9–3.14) and multiple platforms, making installation straightforward. It is actively maintained and tracks Comrak 0.54. The package is suitable for applications that need fast, standards-compliant markdown processing with access to advanced parsing and rendering options.
Use it for:
- Convert user-supplied markdown to safe HTML in web applications or content management systems.
- Normalize and reformat markdown documents using CommonMark output and list-style options.
- Parse markdown with GitHub Flavored Markdown extensions (tables, strikethrough, autolinks) for documentation tools.
- Render markdown alerts and semantic HTML features in static site generators or documentation platforms.
- Process markdown with shortcode expansion (emoji, custom tags) in content pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Renders CommonMark and GitHub Flavored Markdown to HTML or normalized CommonMark via Python bindings to the Rust Comrak parser.
Yes. The package is actively maintained, has no known vulnerabilities, zero runtime dependencies, and offers prebuilt wheels across major platforms and Python versions. It provides a fast, standards-compliant markdown parser with a rich options API. Install it if you need CommonMark/GFM parsing with performance or advanced rendering control; skip it if you need only basic markdown-to-HTML conversion and are comfortable with slower pure-Python alternatives.
Install
comrak on PyPI
pip
pip install comrakuv
uv add comrakpoetry
poetry add comrakInstalling comrak
Before you install
Medium install friction due to compiled wheels, but prebuilt binaries are available for Python 3.9–3.14 across Linux, macOS, and Windows architectures. Last release 18 days ago; repository is active with recent commits.
License in practice
Licensed under permissive terms (2-Clause BSD per the description); no restrictions on commercial or proprietary use.
Quickstart
pip install comrak
import comrak
html = comrak.render_markdown("# Hello")
commonmark = comrak.render_commonmark("- one\n- two")
Requires Python 3.9 or later.
Verify before relying
- Whether the package's performance claims (15x–60x faster than markdown/markdown2) remain current and reproducible.
- Whether all comrak 0.54 features are fully exposed or if new Rust library releases introduce gaps.
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 — 18 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 284,097/month — #8,067 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: comrak-0.0.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; comrak-0.0.16-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; comrak-0.0.16-cp311-abi3-macosx_10_12_x86_64.whl; comrak-0.0.16-cp311-abi3-macosx_11_0_arm64.whl; comrak-0.0.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; comrak-0.0.16-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl; comrak-0.0.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; comrak-0.0.16-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl; comrak-0.0.16-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; comrak-0.0.16-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl; comrak-0.0.16-cp314-abi3-win32.whl; comrak-0.0.16-cp314-abi3-win_amd64.whl; comrak-0.0.16-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; comrak-0.0.16-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl; comrak-0.0.16-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; comrak-0.0.16-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; comrak-0.0.16-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; comrak-0.0.16-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl; comrak-0.0.16-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; comrak-0.0.16-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl
Keywords: markdown, html, rust, commonmark, gfm, parser
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
multimarkConverts Markdown to HTML, LaTeX, groff man,…
permissive · top 15,000 on PyPI
pyromarkpyromark is a CommonMark-compliant Markdown…
unclear · top 15,000 on PyPI
markdown-it-pyrsA Rust-backed Python Markdown parser that…
permissive · top 15,000 on PyPI
cmarkgfmConverts CommonMark and GitHub-flavored…
permissive · top 15,000 on PyPI
commonmarkParses Markdown text according to the…
permissive · top 5,000 on PyPI
markoMarko is a pure Python markdown parser that…
permissive · top 5,000 on PyPI
html-to-markdownConverts real-world HTML—including malformed…
permissive · top 5,000 on PyPI
cohere-melodyParses and renders templated text for Cohere…
permissive · top 15,000 on PyPI
gripGrip is a command-line server that renders…
permissive · top 15,000 on PyPI