Python-Markdown

Python-Markdown is a Python implementation of John Gruber's Markdown, highly compliant with the reference implementation, with an extension mechanism that adds tables, footnotes, a table of contents, and more.

3.11.2
Published at
8d ago
4,253
Stars
537
Download
Synced at
8d ago

Latest release

3.11.2Oct 19, 2026, 07:41 PM
Downloads slow? Switch the source anytime above

README

Project Overview

Python-Markdown is a Python implementation of John Gruber's Markdown, almost completely compliant with the reference implementation. It converts Markdown text to HTML, ships the common syntax elements, and offers a rich extension mechanism — tables, footnotes, a table of contents, and code highlighting are all available through extensions.

Item Value
Platform cross-platform (pure Python)
Language Python
License BSD 3-Clause
Extensions built-in + third-party

One function call turns Markdown text into standard HTML.

Key Features

  • Core conversion: markdown.markdown converts text to HTML in one step
  • Extension mechanism: official extensions for tables, footnotes, a TOC, attribute lists, and more
  • Third-party ecosystem: community extensions cover code highlighting, task lists, and beyond
  • CLI tool: the markdown_py command converts files right after installation
  • Flexible API: custom output formats and custom extension registration are supported
  • High compatibility: behavior closely matches the Markdown reference implementation

Target Audience

  • Web developers rendering Markdown
  • Documentation site and blog builders
  • Teams building note-taking or content management tools
  • Engineers who need custom Markdown syntax

Quick Start

  1. Install
pip install markdown
  1. Convert text
import markdown

html = markdown.markdown('# Hello')
  1. Enable extensions such as tables and footnotes
html = markdown.markdown(text, extensions=['tables', 'footnotes'])

Core Advantages

  • Standard compliant: output stays reliable by matching the reference implementation
  • Extensions on demand: the core stays lean while enhancements stack via extensions
  • Mature ecosystem: long maintained and widely used, with complete docs and extensions

System Requirements

Item Requirement
Language Python
OS cross-platform
Extra deps pure Python, no mandatory dependencies

Notes

  • No sanitizing built in: the library does not filter HTML, pair it with a sanitizer to prevent XSS from user content
  • Extensions must be enabled: tables, footnotes, and similar are not default syntax, load them explicitly

Release history

Sort