py-gfm documentation

Build status Coverage status Documentation status

This is an implementation of GitHub-Flavored Markdown written as an extension to the Python Markdown library. It aims for maximal compatibility with GitHub’s rendering.

py-gfm code is under a BSD-style license.


pip install py-gfm

Quick start

All-in-one extension

import markdown
from mdx_gfm import GithubFlavoredMarkdownExtension

source = """
Hello, *world*! This is a ~~good~~marvelous day!
Here is an auto link:

Le me introduce you to [task lists] (

- [ ] eggs
- [x] milk

You can also have fenced code blocks:

import this

# Direct conversion
html = markdown.markdown(source,

# Factory-like
md = markdown.Markdown(extensions=[GithubFlavoredMarkdownExtension()])
html = md.convert(source)

À la carte

import markdown
from gfm import AutolinkExtension, TaskListExtension

html = markdown.markdown(source,

Supported features

  • Fenced code blocks
  • Literal line breaks
  • Tables
  • Hyperlink parsing (http, https, ftp, email and www subdomains)
  • Code highlighting (dummy, no actual syntactic coloration as-is)
  • Mixed-style lists with no separation
  • Links and images with whitespace
  • Strikethrough
  • Task lists

Unsupported features

This implementation does not support all of GFM features.

By design

  • Link to commits, issues, pull requests and user profiles: this is application specific. Feel free to subclass the provided classes to implement your own logic.


  • Horizontal rules
  • Emojis

Indices and tables