skillfed

cmarkgfm

Minimal bindings to GitHub's fork of cmark

cmarkgfm v2025.10.22 586.0K downloads/30d#5,883 on PyPI96
Permissive license MIT AGING released

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 cmarkgfm

uv

uv add cmarkgfm

poetry

poetry add cmarkgfm

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Build Tools

Tags

markdown to html convertergithub flavored markdown parsercommonmark renderermarkdown html bindingsgfm markdown processorcmark python wrapper
markdown-parsinghtml-rendering

More Build Tools packages