comrak 0.0.15


pip install comrak

  Latest version

Released: Jul 25, 2026


Meta
Author: Louis Maddox
Requires Python: >=3.9

Classifiers

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Programming Language
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Operating System
  • OS Independent

Typing
  • Typed

comrak

uv pdm-managed PyPI Supported Python versions License pre-commit.ci status

Python bindings for the Comrak Rust library, a fast CommonMark/GFM parser.

Currently tracking comrak 0.54.

Installation

pip install comrak

Requirements

  • Python 3.9+

Usage

>>> import comrak
>>> comrak.render_markdown("# Hello")
'<h1>Hello</h1>\n'

Options

Every option in comrak's Extension, Parse and Render structs is exposed, with the same name and the same default:

>>> opts = comrak.ExtensionOptions()
>>> comrak.render_markdown("foo :smile:", extension_options=opts)
'<p>foo :smile:</p>\n'
>>> opts.shortcodes = True
>>> comrak.render_markdown("foo :smile:", extension_options=opts)
'<p>foo ๐Ÿ˜„</p>\n'

The three option objects are independent and can be combined:

>>> ext = comrak.ExtensionOptions()
>>> ext.alerts = True
>>> render = comrak.RenderOptions()
>>> render.alert_style = comrak.AlertStyle.Semantic
>>> comrak.render_markdown("> [!note]\n> Note this!",
...                        extension_options=ext, render_options=render)
'<aside class="admonition note">\n...'

For what each option does, see comrak's own documentation. The field names match one-for-one:

Two options take enums rather than raw values: RenderOptions.alert_style (comrak.AlertStyle) and RenderOptions.list_style (comrak.ListStyle). Both compare equal to their integer discriminants.

The one naming difference from the Rust API is:

Rust Python
render.unsafe RenderOptions.unsafe_

ExtensionOptions.header_ids is a deprecated alias for header_id_prefix and raises a FutureWarning; it will be removed in a future release.

Not exposed

  • parse.broken_link_callback โ€” see tracking issue
  • extension.phoenix_heex โ€” gated behind a comrak crate feature that isn't built here
  • Plugins (syntax highlighting, heading adapters)

Only HTML output is available, via render_markdown. The options that solely affect comrak's CommonMark formatter (width, list_style, prefer_fenced, ol_width, experimental_minimize_commonmark) are settable for API parity but currently have no effect.

Benchmarks

Tested with small (8 lines) and medium (1200 lines) markdown strings

Contributing

Maintained by lmmx. Contributions welcome!

  1. Issues & Discussions: Please open a GitHub issue or discussion for bugs, feature requests, or questions.
  2. Pull Requests: PRs are welcome!
    • Set up with uv: uv sync
    • Build and test: uv run maturin develop && uv run pytest
    • If reporting a bug, please include the version and the error message/traceback if available.

New comrak options are caught at compile time by an exhaustiveness check in src/options.rs, and untested options are caught by TestOptionCoverage in tests/comrak_test.py. This was introduced to help keep track of new comrak features and their test coverage in this library.

License

Licensed under the 2-Clause BSD License. See LICENSE for all the details.

Wheel compatibility matrix

Platform CPython 3.9 CPython >=3.9 (abi3) CPython 3.10 CPython 3.11 CPython >=3.11 (abi3) CPython 3.12 CPython 3.13 CPython 3.14 CPython >=3.14 (abi3) CPython 3.15 (abi3t) CPython >=3.15 (abi3) CPython (additional flags: t) 3.14 PyPy 3.11 (pp73)
macosx_10_12_x86_64
macosx_11_0_arm64
manylinux1_i686
manylinux2014_aarch64
manylinux2014_armv7l
manylinux2014_ppc64le
manylinux2014_s390x
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_armv7l
manylinux_2_17_ppc64le
manylinux_2_17_s390x
manylinux_2_17_x86_64
manylinux_2_5_i686
musllinux_1_2_aarch64
musllinux_1_2_armv7l
musllinux_1_2_i686
musllinux_1_2_x86_64
win32
win_amd64

Files in release

comrak-0.0.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (589.3KiB)
comrak-0.0.15-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (612.2KiB)
comrak-0.0.15-cp311-abi3-macosx_10_12_x86_64.whl (520.3KiB)
comrak-0.0.15-cp311-abi3-macosx_11_0_arm64.whl (513.4KiB)
comrak-0.0.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (585.6KiB)
comrak-0.0.15-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (608.9KiB)
comrak-0.0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (585.0KiB)
comrak-0.0.15-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl (606.5KiB)
comrak-0.0.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (584.8KiB)
comrak-0.0.15-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl (606.5KiB)
comrak-0.0.15-cp314-abi3-win32.whl (391.3KiB)
comrak-0.0.15-cp314-abi3-win_amd64.whl (401.8KiB)
comrak-0.0.15-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (584.7KiB)
comrak-0.0.15-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl (606.6KiB)
comrak-0.0.15-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (658.7KiB)
comrak-0.0.15-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (614.5KiB)
comrak-0.0.15-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (677.4KiB)
comrak-0.0.15-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl (721.7KiB)
comrak-0.0.15-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (585.1KiB)
comrak-0.0.15-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl (606.3KiB)
comrak-0.0.15-cp314-cp314t-musllinux_1_2_aarch64.whl (832.5KiB)
comrak-0.0.15-cp314-cp314t-musllinux_1_2_armv7l.whl (879.6KiB)
comrak-0.0.15-cp314-cp314t-musllinux_1_2_i686.whl (813.8KiB)
comrak-0.0.15-cp314-cp314t-musllinux_1_2_x86_64.whl (838.7KiB)
comrak-0.0.15-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (590.0KiB)
comrak-0.0.15-cp315-abi3.abi3t-manylinux_2_5_i686.manylinux1_i686.whl (611.7KiB)
comrak-0.0.15-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (664.7KiB)
comrak-0.0.15-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (620.9KiB)
comrak-0.0.15-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (684.3KiB)
comrak-0.0.15-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (726.9KiB)
comrak-0.0.15-cp39-abi3-musllinux_1_2_aarch64.whl (840.0KiB)
comrak-0.0.15-cp39-abi3-musllinux_1_2_armv7l.whl (889.4KiB)
comrak-0.0.15-cp39-abi3-musllinux_1_2_i686.whl (821.7KiB)
comrak-0.0.15-cp39-abi3-musllinux_1_2_x86_64.whl (846.0KiB)
comrak-0.0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (592.8KiB)
comrak-0.0.15-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (614.8KiB)
comrak-0.0.15-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (660.3KiB)
comrak-0.0.15-pp311-pypy311_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (617.1KiB)
comrak-0.0.15-pp311-pypy311_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (679.6KiB)
comrak-0.0.15-pp311-pypy311_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (721.9KiB)
comrak-0.0.15-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (587.5KiB)
comrak-0.0.15-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl (610.4KiB)
comrak-0.0.15-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl (834.9KiB)
comrak-0.0.15-pp311-pypy311_pp73-musllinux_1_2_armv7l.whl (884.0KiB)
comrak-0.0.15-pp311-pypy311_pp73-musllinux_1_2_i686.whl (818.0KiB)
comrak-0.0.15-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl (841.1KiB)
comrak-0.0.15.tar.gz (54.0KiB)
No dependencies