$npx skillfedfor your agent

premailer

Turns CSS blocks into style attributes

With conditionsPyPI Python ModulesReleased Aug 20215.0M downloads / moPythonPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — premailer-3.10.0-py2.py3-none-any.whl
v3.10.0 · released 2021-08-02 · 5 runtime deps: lxml, cssselect, cssutils, requests, cachetools

Yes, if you are building email systems. Premailer solves a real, specific problem—email clients require inline styles—and does it reliably. The dormant maintenance is a minor concern given the stable classifier and zero known vulnerabilities, but verify that its CSS and HTML parsing behavior still meets your email client compatibility needs before adopting it for new projects.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • By default, premailer attempts to download external stylesheets over the network; use allow_network=False to prevent this if needed.
  • Low friction: pure Python wheel with five straightforward runtime dependencies (lxml, cssselect, cssutils, requests, cachetools).
  • Maintenance is dormant—last release was 2021-08-02 and last commit 2023-12-16—but the package is marked Production/Stable and has no known vulnerabilities.

License · maintenance · safety

Python (permissive) — Licensed under the Python Software Foundation License, a permissive license. No restrictions on use, modification, or distribution in commercial or private projects.

last release 2021-08-02 (1838 days) · last repo commit 2023-12-16 · 1,084 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,013,987 downloads/mo, #2,181 on PyPI

Verify before relying

pip install premailer

from premailer import transform
html = '<style>p { color: red; }</style><p>Hello</p>'
result = transform(html)
print(result)
  • Whether the dormant maintenance status (last release 2021-08-02) affects compatibility with modern email clients or CSS specifications.
  • Performance characteristics when processing large HTML documents or many external stylesheets.
Same gist for agents: .md · .json

What it is and what it does

Premailer is a Python library that transforms HTML documents by inlining CSS styles into HTML element attributes. It parses HTML, extracts CSS from style blocks and external stylesheets, and rewrites the DOM to apply those styles as inline style attributes—a requirement for most email clients, which strip out style tags for security reasons.

The package handles relative URL rewriting (converting relative links to absolute ones using a base URL), CSS selector parsing via cssutils and cssselect, and HTML parsing via lxml. It offers both a simple transform() function for basic use and a full Premailer class for advanced configuration. It can preserve or strip certain CSS features (pseudoclasses, !important declarations, class attributes) and supports command-line usage for batch processing.

Use it for

  • Prepare HTML newsletters and transactional emails for delivery by inlining all styles before sending.
  • Convert relative URLs in email templates to absolute URLs using a base_url parameter.
  • Strip !important declarations and pseudoclasses from CSS to ensure compatibility with email clients.
  • Process HTML templates from a file or stdin via the command-line interface for CI/CD pipelines.
  • Preserve specific CSS or links (e.g., handlebar syntax, cid: attachments) while inlining other styles.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are building email systems.

Premailer solves a real, specific problem—email clients require inline styles—and does it reliably. The dormant maintenance is a minor concern given the stable classifier and zero known vulnerabilities, but verify that its CSS and HTML parsing behavior still meets your email client compatibility needs before adopting it for new projects.

Install

premailer on PyPI

Before you install

Low friction: pure Python wheel with five straightforward runtime dependencies (lxml, cssselect, cssutils, requests, cachetools). Maintenance is dormant—last release was 2021-08-02 and last commit 2023-12-16—but the package is marked Production/Stable and has no known vulnerabilities.

By default, premailer attempts to download external stylesheets over the network; use allow_network=False to prevent this if needed.

License in practice

Licensed under the Python Software Foundation License, a permissive license. No restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install premailer

from premailer import transform
html = '<style>p { color: red; }</style><p>Hello</p>'
result = transform(html)
print(result)

Verify before relying

  • Whether the dormant maintenance status (last release 2021-08-02) affects compatibility with modern email clients or CSS specifications.
  • Performance characteristics when processing large HTML documents or many external stylesheets.

Package facts

LicensePython permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
lxmlcssselectcssutilsrequestscachetools
MaintenanceDormant 1,838 days since the last release
Last repo commit
First released
Downloads5,013,987 / month, #2,181 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: Other EnvironmentEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: Python Software Foundation LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: CommunicationsTopic :: Internet :: WWW/HTTPTopic :: Other/Nonlisted TopicTopic :: Software Development :: Libraries :: Python Modules

Evidence: premailer-3.10.0-py2.py3-none-any.whl

Tags

Capabilities
css to inline styleshtml email preprocessingstyle tag inliningemail html transformationcss inlining for emailhtml style attributesemail client compatibility
Topics
email-processinghtml-transformationcss-inlining
PyPI keywords
htmllxmlemailmailstyle

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 › “html email preprocessing”

  • premailerConverts CSS style blocks into inline style attributes on HTML…
  • unstructuredIngests and pre-processes unstructured documents (PDFs, HTML, Word,…
  • pretty-html-tableConverts pandas DataFrames into styled HTML tables ready for email,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also django-premailer · css-inline · pynliner · email-to · cssutils · emails · prettierfier · pretty-html-table · webcolors · djangocms-admin-style