Skip to main content

markdown-it-py

Github-CI Coverage Status PyPI Conda PyPI - Downloads

markdown-it-py icon

Markdown parser done right.

This is a Python port of markdown-it, and some of its associated plugins. For more details see: https://markdown-it-py.readthedocs.io.

For details on markdown-it itself, see:

See also: markdown-it-pyrs for an experimental Rust binding, for even more speed!

Installation

PIP

pip install markdown-it-py[plugins]

or with extras

pip install markdown-it-py[linkify,plugins]

Conda

conda install -c conda-forge markdown-it-py

or with extras

conda install -c conda-forge markdown-it-py linkify-it-py mdit-py-plugins

Usage

Python API Usage

Render markdown to HTML with markdown-it-py and a custom configuration with and without plugins and features:

from markdown_it import MarkdownIt
from mdit_py_plugins.front_matter import front_matter_plugin
from mdit_py_plugins.footnote import footnote_plugin

md = (
    MarkdownIt("commonmark", {"breaks": True, "html": True})
    .use(front_matter_plugin)
    .use(footnote_plugin)
    .enable("table")
)
text = """
---
a: 1
---

a | b
- | -
1 | 2

A footnote [^1]

[^1]: some details
"""
tokens = md.parse(text)
html_text = md.render(text)

## To export the html to a file, uncomment the lines below:
# from pathlib import Path
# Path("output.html").write_text(html_text)

Command-line Usage

Render markdown to HTML with markdown-it-py from the command-line:

usage: markdown-it [-h] [-v] [--stdin] [--enable-tables] [filenames ...]

Parse one or more markdown files, convert each to HTML, and print to stdout

positional arguments:
  filenames        specify an optional list of files to convert

options:
  -h, --help       show this help message and exit
  -v, --version    show program's version number and exit
  --stdin          read Markdown from standard input
  --enable-tables  enable table parsing

Interactive:

  $ markdown-it
  markdown-it-py [version 0.0.0] (interactive)
  Type Ctrl-D to complete input, or Ctrl-C to exit.
  >>> # Example
  ... > markdown *input*
  ...
  <h1>Example</h1>
  <blockquote>
  <p>markdown <em>input</em></p>
  </blockquote>

Batch:

  $ markdown-it README.md README.footer.md > index.html

In interactive mode, end each input with Ctrl-D, or on Windows with Ctrl-Z then Enter (the prompt names the keys for your platform).

Tables are disabled by default, as in CommonMark. Use --enable-tables with any input mode to enable them:

markdown-it --enable-tables README.md > index.html
markdown-it --enable-tables --stdin < README.md > index.html
markdown-it --enable-tables

References / Thanks

Big thanks to the authors of markdown-it:

Also John MacFarlane for his work on the CommonMark spec and reference implementations.

Metadata

Release files for markdown-it-py 4.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markdown-it-py 4.3.0
File Size Uploaded Provenance Actions
markdown_it_py-4.3.0.tar.gz 242.7 kB With provenance Details for markdown_it_py-4.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for markdown-it-py 4.3.0
File Interpreter ABI Platform Actions
markdown_it_py-4.3.0-py3-none-any.whl Python 3 none any Details for markdown_it_py-4.3.0-py3-none-any.whl

Total release size: 339.7 kB

Release files / markdown_it_py-4.3.0.tar.gz

Download URL markdown_it_py-4.3.0.tar.gz
Size 242.7 kB
Tags Source
SHA-256 checksum
How to use checksums
91a58fa5b72c71a40cf7177250fd767480d7a2bb3ac426ccfb76fb90305fdaaa
BLAKE2b-256 checksum
How to use checksums
16fccee2c45553c9a9bf77d8b0c391560c556d7ed756b1f0bb35eb5d48db09ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / markdown_it_py-4.3.0-py3-none-any.whl

Download URL markdown_it_py-4.3.0-py3-none-any.whl
Size 97.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7aa1511a46c39138de78d9eba92ce47e63124d8003fc98b3a351909e04239efa
BLAKE2b-256 checksum
How to use checksums
c9315f0ac2f1a1c67423c995c731a11cd4ad05d081a2be969d74f868bdb9cc70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for markdown-it-py 4.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for markdown_it_py-4.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page