skillfed

commonmark

Python parser for the CommonMark Markdown spec

commonmark v0.9.2 6.0M downloads/30d#1,992 on PyPI236
Permissive license BSD-3-Clause Abandoned released

What it is and what it does

commonmark.py is a pure Python implementation of the CommonMark Markdown specification, ported from the original JavaScript commonmark.js. It parses Markdown text into an abstract syntax tree and can render that tree to HTML, JSON, or formatted AST output. The package includes both a Python API and a command-line tool (cmark) for processing Markdown files.

The package depends only on future for Python 2/3 compatibility. However, it is now deprecated and abandoned—the repository is archived with no active maintenance. The maintainers recommend using an alternative for new projects.

Use it for:

  • Convert Markdown files to HTML in a legacy codebase that already uses commonmark.py
  • Parse Markdown to inspect or manipulate the abstract syntax tree programmatically
  • Render Markdown to JSON for downstream processing or analysis
  • Use the cmark command-line tool to batch-convert Markdown documentation to HTML

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses Markdown text according to the CommonMark specification and renders it to HTML, JSON, or an abstract syntax tree using pure Python.

No. The package is abandoned with no active maintenance and the repository is archived. While it has no known security vulnerabilities and low install friction, the lack of maintenance makes it unsuitable for new projects. Install only if you are maintaining legacy code that already depends on it.

Install

commonmark on PyPI

pip

pip install commonmark

uv

uv add commonmark

poetry

poetry add commonmark

Installing commonmark

Before you install

Installation is straightforward with low friction. However, the package is now abandoned—the repository is archived and the last commit was 2026-05-29. No active maintenance is occurring.

License in practice

Licensed under BSD-3-Clause (permissive), which allows commercial and private use with minimal restrictions, requiring only that the license and copyright notice be included.

Quickstart

pip install commonmark

import commonmark
parser = commonmark.Parser()
ast = parser.parse("Hello *World*")
renderer = commonmark.HtmlRenderer()
html = renderer.render(ast)

Verify before relying

  • Whether the CommonMark spec version supported by 0.9.2 remains adequate for current use cases
  • Migration path and compatibility with recommended alternatives

Package facts

License BSD-3-Clause (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — future
Maintenance abandoned — 78 days since the last release
Last repo commit (repository archived)
First released
Downloads 5,997,233/month — #1,992 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: commonmark-0.9.2-py2.py3-none-any.whl

Keywords: markup, markdown, commonmark

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: DocumentationTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: DocumentationTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: MarkupTopic :: Utilities

Tags

commonmark markdown parsermarkdown to html conversioncommonmark spec implementationmarkdown ast parsermarkdown renderer python
deprecatedmarkdown-parser

More Python Modules packages