commonmark
Python parser for the CommonMark Markdown spec
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 commonmarkuv
uv add commonmarkpoetry
poetry add commonmarkInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
markoMarko is a pure Python markdown parser that…
permissive · top 5,000 on PyPI
multimarkConverts Markdown to HTML, LaTeX, groff man,…
permissive · top 15,000 on PyPI
mistletoemistletoe is a pure-Python Markdown parser that…
permissive · top 5,000 on PyPI
cmarkgfmConverts CommonMark and GitHub-flavored…
permissive · top 15,000 on PyPI
markdown-it-pyrsA Rust-backed Python Markdown parser that…
permissive · top 15,000 on PyPI
comrakRenders CommonMark and GitHub Flavored Markdown…
permissive · top 15,000 on PyPI
pyromarkpyromark is a CommonMark-compliant Markdown…
unclear · top 15,000 on PyPI
mdurlProvides URL parsing and manipulation utilities…
permissive · top 100 on PyPI
mdit-plainConverts markdown documents to plain text by…
permissive · top 15,000 on PyPI