Skip to main content

Prepare HTML for email; embedd CSS to inline.

Project description

python-premailer converts HTML with style tags into HTML with inline style attributes; gmail won’t render nice without it!

I made it so I could send colorized git diffs of func-inventory around…

Use:

$ sudo pip install python-premailer

$ python

>>> from pypremailer import Premailer
>>> p = Premailer('<html><head><style>foo {size:10px;}</style></head><body><span class="foo">bar</span></html>')
>>> p.premail()

<html><head></head><body><span style=”size: 10px”>bar</span></body></html>

Get the source:

http://github.com/ralphbean/python-premailer

On PyPI:

http://pypi.python.org/pypi/python-premailer

Excuses, excuses

This definitely already exists in pypi under the name ‘premailer’, but I wanted to reimplement it without the use of lxml.

Check it out! http://pypi.python.org/pypi/premailer

Inspired by

Emogrifier (php): http://www.pelagodesign.com/sidecar/emogrifier/

Premailer (ruby): http://premailer.dialect.ca/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-premailer-0.5.3.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file python-premailer-0.5.3.tar.gz.

File metadata

File hashes

Hashes for python-premailer-0.5.3.tar.gz
Algorithm Hash digest
SHA256 b49833d2c5aa5fd6697d8aeac716e82b01baaf0cba3e1cc89c9c318d661c9149
MD5 a9381547113e16f47b854ddaf1efeece
BLAKE2b-256 0bd9311f48ac3be4771765dcecce80bf632706cd21b0a5e6b8814a40ad89032b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page