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

###

from pypremailer import Premailer

html = sys.stdin.read()

premailer = Premailer(html)

inlined_html = premailer.premail()

print inlined_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.2.tar.gz (2.3 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for python-premailer-0.5.2.tar.gz
Algorithm Hash digest
SHA256 b498753bb54c419a33cbe39b45335520712a86ab6cadf69e88cb11485660150d
MD5 875639c0cc556935ecf0ef3c8c25d66b
BLAKE2b-256 db97ae37baa938d8de74db21a13b88f2ee7d93628fa4653ed8df10f1ed26754e

See more details on using hashes here.

Supported by

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