Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 2.33 KB

README.md

File metadata and controls

62 lines (42 loc) · 2.33 KB

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

Installation

pip install comrak

Requirements

  • Python 3.9+

Features

Fast Markdown to HTML parser in Rust, shipped for Python via PyO3.

Options

All options are exposed in a simple manner:

>>> import comrak
>>> 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'

Refer to the Comrak docs for all available options.

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!
    • Install the dev extra (e.g. with uv: uv pip install -e .[dev])
    • Run tests (when available) and include updates to docs or examples if relevant.
    • If reporting a bug, please include the version and the error message/traceback if available.

License

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