cmarkgfm
Minimal bindings to GitHub's fork of cmark
What it is and what it does
cmarkgfm is a minimal Python wrapper around GitHub's fork of the cmark CommonMark parser. It exposes two main rendering functions: one for standard CommonMark markdown and another for GitHub-flavored markdown (GFM), both producing HTML output. The package depends on cffi to interface with the underlying C library.
The library supports a range of rendering options—including smart typography, footnotes, strikethrough, tables, and source position tracking—that can be combined and passed to either rendering function. By default (since version 0.5.0), rendering is safe and blocks potentially dangerous HTML and JavaScript-based URLs; earlier versions rendered unsafely by default. Wheels are provided for modern Python versions on macOS, Linux, and Windows, making installation friction low on common platforms.
Use it for:
- Convert user-submitted markdown comments or documentation to HTML in web applications.
- Render GitHub-flavored markdown (tables, strikethrough, task lists) in static site generators or documentation tools.
- Parse and sanitize markdown input with configurable safety options to prevent XSS attacks.
- Build markdown preview or editing tools that need fast, standards-compliant HTML output.
- Process markdown files with GitHub-specific extensions in CI/CD pipelines or build systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts CommonMark and GitHub-flavored markdown to HTML using Python bindings to GitHub's fork of cmark.
Yes, if you need to render CommonMark or GitHub-flavored markdown to HTML in Python. The package is stable, has no known vulnerabilities, supports current Python versions, and provides prebuilt wheels for easy installation. The aging maintenance status (296 days since last release) is not a blocker for a mature, focused library; however, if you need active development or rapid bug fixes, verify the maintainer's responsiveness first.
Install
cmarkgfm on PyPI
pip
pip install cmarkgfmuv
uv add cmarkgfmpoetry
poetry add cmarkgfmInstalling cmarkgfm
Before you install
Medium install friction due to compiled wheels; however, prebuilt binaries are available for macOS, Linux, and Windows across Python 3.9–3.14, making installation straightforward on supported platforms. Last release was 296 days ago; the repository is active but aging.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice.
Quickstart
pip install cmarkgfm
import cmarkgfm
html = cmarkgfm.markdown_to_html("# Hello")
# or for GitHub-flavored markdown:
html = cmarkgfm.github_flavored_markdown_to_html("# Hello")
Requires Python 3.9 or later; cffi is a runtime dependency.
Verify before relying
- Whether the package's aging status (296 days since last release) signals maintenance concerns or stable maturity.
- Performance characteristics when rendering large markdown documents or high-volume conversions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — cffi |
| Maintenance | aging — 296 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 585,965/month — #5,883 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cmarkgfm-2025.10.22-cp310-cp310-macosx_11_0_arm64.whl; cmarkgfm-2025.10.22-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cmarkgfm-2025.10.22-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cmarkgfm-2025.10.22-cp310-cp310-musllinux_1_2_aarch64.whl; cmarkgfm-2025.10.22-cp310-cp310-musllinux_1_2_x86_64.whl; cmarkgfm-2025.10.22-cp310-cp310-win32.whl; cmarkgfm-2025.10.22-cp310-cp310-win_amd64.whl; cmarkgfm-2025.10.22-cp311-cp311-macosx_11_0_arm64.whl; cmarkgfm-2025.10.22-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cmarkgfm-2025.10.22-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cmarkgfm-2025.10.22-cp311-cp311-musllinux_1_2_aarch64.whl; cmarkgfm-2025.10.22-cp311-cp311-musllinux_1_2_x86_64.whl; cmarkgfm-2025.10.22-cp311-cp311-win32.whl; cmarkgfm-2025.10.22-cp311-cp311-win_amd64.whl; cmarkgfm-2025.10.22-cp312-cp312-macosx_11_0_arm64.whl; cmarkgfm-2025.10.22-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cmarkgfm-2025.10.22-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cmarkgfm-2025.10.22-cp312-cp312-musllinux_1_2_aarch64.whl; cmarkgfm-2025.10.22-cp312-cp312-musllinux_1_2_x86_64.whl; cmarkgfm-2025.10.22-cp312-cp312-win32.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
multimarkConverts Markdown to HTML, LaTeX, groff man,…
permissive · 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
gripGrip is a command-line server that renders…
permissive · top 15,000 on PyPI
py-gfmConverts GitHub-Flavored Markdown to HTML using…
permissive · top 15,000 on PyPI
markoMarko is a pure Python markdown parser that…
permissive · top 5,000 on PyPI
mdformat-gfmMdformat-gfm extends mdformat to format GitHub…
permissive · top 5,000 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
markdown-it-pyrsA Rust-backed Python Markdown parser that…
permissive · top 15,000 on PyPI
gh-md-to-htmlConverts GitHub-flavored Markdown to HTML with…
unclear · top 15,000 on PyPI