--- id: mistletoe version: "1.6.0" license: MIT license_treatment: permissive maintenance: active --- # mistletoe — A fast, extensible Markdown parser in pure Python. License: permissive · Maintenance: active · Downloads: 2.3M/mo ## What it is and what it does mistletoe parses Markdown into an abstract syntax tree (AST) and renders it to multiple output formats. It implements the CommonMark specification for predictable, spec-compliant parsing, and supports native extensions like strikethrough and tables. The design separates parsing from rendering, so you can swap renderers without modifying core logic. The package ships with built-in renderers for HTML, LaTeX, AST (for debugging), and Markdown (for reflowing or automated edits). Additional renderers for MathJax, Pygments highlighting, GitHub wiki links, Jira, XWiki, and Scheme are available in a contrib package. It works as both a Python library and a command-line tool, and includes an interactive REPL mode for testing. Use it for: - Convert Markdown files to HTML or LaTeX for documentation generation or publishing workflows. - Parse Markdown into an AST to programmatically inspect or transform document structure. - Reflow Markdown text to a specific line length or apply automated edits to Markdown documents. - Build custom renderers for domain-specific output formats by extending the parser's token system. - Use the command-line tool to batch-convert Markdown files without writing Python code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. mistletoe is a pure-Python Markdown parser that converts Markdown documents into an abstract syntax tree, then renders them to HTML, LaTeX, Markdown, or custom formats via pluggable renderers. Yes. mistletoe is actively maintained, has no dependencies, installs with low friction, carries no known vulnerabilities, and offers a clean API for both library and CLI use. Install it if you need CommonMark-compliant Markdown parsing with extensible rendering or if you want to programmatically manipulate Markdown documents. ## Install pip install mistletoe uv add mistletoe poetry add mistletoe ## Installing mistletoe Before you install: Low friction: pure Python with no runtime dependencies, distributed as a wheel, and actively maintained with a recent release. License in practice: MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license in distributions. Quickstart: pip install mistletoe import mistletoe with open('foo.md', 'r') as fin: rendered = mistletoe.markdown(fin) Verify before relying: - Whether performance claims ('fastest CommonMark implementation in pure Python') are independently verified or benchmarked. - Whether custom token definitions and renderer extensions are documented with examples beyond the description excerpt. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags markdown parser python, commonmark compliant parser, markdown to html converter, markdown ast renderer, markdown to latex, extensible markdown parser, markdown document processor, markdown-parser, ast-rendering, commonmark [View on SkillFed](https://skillfed.io/packages/mistletoe) · [View on PyPI](https://pypi.org/project/mistletoe/)