python-premailer
Port variant py37
Summary Turns CSS blocks into style attributes (PY37)
Package version 3.7.0
Homepage https://github.com/peterbe/premailer
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py38
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 07 MAY 2020, 23:38:01 UTC
Port created 21 APR 2020, 22:22:44 UTC
Subpackage Descriptions
single premailer ========= Looking for sponsors -------------------- This project is actively looking for corporate sponsorship. If you want to help making this an active project consider [pinging Peter] and we can talk about putting up logos and links to your company. Python versions --------------- Our `tox.ini `__ makes sure premailer works in: - Python 3.4 - Python 3.5 - Python 3.6 - Python 3.7 - Python 3.8 - PyPy Turns CSS blocks into style attributes -------------------------------------- When you send HTML emails you can't use style tags but instead you have to put inline style attributes on every element. So from this: .. code:: html

Peter

Hej

You want this: .. code:: html

Peter

Hej

premailer does this. It parses an HTML page, looks up style blocks and parses the CSS. It then uses the ``lxml.html`` parser to modify the DOM tree of the page accordingly. Warning! By default, premailer will attempt to download any external stylesheets by URL over the Internet. If you want to prevent this you can use the ``allow_network=False`` option. Getting started --------------- If you haven't already done so, install premailer first: :: $ pip install premailer Next, the most basic use is to use the shortcut function, like this: .. code:: python >>> from premailer import transform >>> print(transform(""" ... ... ... ...

Peter

...

Hej

... ... """))

Peter

Hej

Configuration Switches (platform-specific settings discarded)
PY37 ON Build using Python 3.7 PY38 OFF Build using Python 3.8
Package Dependencies by Type
Build and Runtime python-lxml:single:py37
python-cssselect:single:py37
python-cssutils:single:py37
python-requests:single:py37
python-cachetools:single:py37
python37:single:standard
python-setuptools:single:py37
Download groups
main mirror://PYPI/p/premailer
Distribution File Information
5eec9603e84cee583a390de69c75192e50d76e38ef0292b027bd64923766aca7 23377 premailer-3.7.0.tar.gz
Ports that require python-premailer:py37
python-reportlib:py37 Generator HTML from pandas via Jinja2 (PY37)