mjml
Python implementation for MJML - a framework that makes responsive-email easy
Decision gist · record as of 2026-08-14
Yes, if you need to generate responsive emails from MJML templates in Python and want to avoid Node.js. The package is actively maintained, has low install friction, carries a permissive MIT license, and has no known vulnerabilities. Be aware that it implements a subset of MJML features and lags behind the JavaScript version; check the documentation to confirm your required components are supported before committing to production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low friction: pure Python wheel with five common dependencies (beautifulsoup4, jinja2, dotmap, docopt-ng, typing_extensions).
- Actively maintained with recent releases; last commit 2026-03-30.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2025-12-27 (230 days) · last repo commit 2026-03-30 · 89 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 465,237 downloads/mo, #6,510 on PyPI
Alternatives
Verify before relying
pip install mjml
from mjml import mjml_to_html
with open('foo.mjml', 'rb') as mjml_fp:
result = mjml_to_html(mjml_fp)
html: str = result.html- Feature parity with the JavaScript mjml v4 implementation — the description notes the Python version lags behind and lacks minification, beautification, and validation.
- Which MJML components are currently implemented beyond 'Hello World', images, tables, and groups.
What it is and what it does
mjml is an unofficial Python port of the MJML markup language, a framework designed to simplify writing responsive emails. It translates MJML (an XML-like dialect) directly to HTML without needing Node.js or a JavaScript runtime. The package is implemented in pure Python and can be used either as a library (via the mjml_to_html function) or as a command-line tool.
The library was created to avoid deploying Node.js in production and to sidestep the security audit burden of the 220+ npm packages required by the official JavaScript implementation. It trades some feature completeness for a lightweight, Python-native alternative: it handles basic components like images, tables, and groups, but does not yet implement all MJML features (minification, beautification, validation). It is actively maintained and deployed in light production scenarios.
Use it for
- Generate responsive email HTML from MJML templates in a Python web application without Node.js overhead.
- Build email templates programmatically using MJML markup in Django or Flask projects.
- Convert MJML files to HTML via CLI for integration into build pipelines or batch email generation.
- Avoid the security and dependency audit burden of npm packages by using a pure-Python email template engine.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to generate responsive emails from MJML templates in Python and want to avoid Node.js.
The package is actively maintained, has low install friction, carries a permissive MIT license, and has no known vulnerabilities. Be aware that it implements a subset of MJML features and lags behind the JavaScript version; check the documentation to confirm your required components are supported before committing to production use.
Install
mjml on PyPI
Before you install
Low friction: pure Python wheel with five common dependencies (beautifulsoup4, jinja2, dotmap, docopt-ng, typing_extensions). Actively maintained with recent releases; last commit 2026-03-30.
Requires Python 3.9 or later.
License in practice
MIT license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install mjml
from mjml import mjml_to_html
with open('foo.mjml', 'rb') as mjml_fp:
result = mjml_to_html(mjml_fp)
html: str = result.html
Verify before relying
- Feature parity with the JavaScript mjml v4 implementation — the description notes the Python version lags behind and lacks minification, beautification, and validation.
- Which MJML components are currently implemented beyond 'Hello World', images, tables, and groups.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesbeautifulsoup4dotmapdocopt-ngjinja2typing_extensions |
| Maintenance | Actively maintained 230 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 465,237 / month, #6,510 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Communications :: EmailTopic :: Text Processing :: Markup :: HTML |
Evidence: mjml-0.12.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “mjml to html converter”
- mjmlConverts MJML (a markup language for responsive emails) to HTML…
- mjml-pythonCompiles MJML email templates to HTML at runtime using an embedded…
- django-mjmlProvides a Django template tag that compiles MJML (Mailjet Markup…
Give your agent the search over MCP, or paste the wish link into any chat.
More HTML packages
MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.
Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.
Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.
Install it if you need to parse or extract data from markup documents.
lxml provides Python bindings to libxml2 and libxslt, enabling parsing, validation, and transformation of XML and HTML documents through an ElementTree-compatible API with support for XPath, XSLT, and schema validation.
Install it if you need robust XML/HTML parsing, validation, or transformation; avoid it only if you must stay pure-Python and can accept slower performance.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
Converts Markdown text to HTML using a Python implementation of John Gruber's Markdown specification, with support for extensions.
Install it if you need to parse Markdown in Python.
See also django-mjml · mjml-python · mrml · branca · emails · markdown2 · html5tagger · mailjet-rest · jsmin · vbuild