Skip to main content

slimmer.py is a whitespace optimizer for CSS, HTML and XHTML output. It’s written by Peter Bengtsson, peter@fry-it.com in 2004-2005. Still maintained in 2008.

INSTALLATION:

$ sudo easy_install slimmer

Alternative:

$ tar -zxvf slimmer-x.x.x.tgz
$ cd slimmer/
$ sudo python setup.py install

USAGE:

>>> import slimmer
>>> from slimmer import css_slimmer
>>> css_slimmer("h1, h2 { font-family: 'Courier New', Courier; }")
"h1,h2{font-family:'Courier New',Courier;border:1px solid black;}"
>>> html_slimmer('<a  href="x" title="   foo  bar  "> one </a>  <br />')
>>> from slimmer import html_slimmer, xhtml_slimmer
>>> html_slimmer('''<a  href="x" title="   foo  bar  "
                  > one </a>  <br/>''')
'<a href="x" title="   foo bar  "> one </a><br />'

UNITTESTS:

$ cd slimmer/tests
$ python testSlimmer.py
$ python testSlimmer.py --verbose

Release files for slimmer 0.1.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slimmer 0.1.30
File Size Uploaded
slimmer-0.1.30.tar.gz 17.0 kB Details

Release files / slimmer-0.1.30.tar.gz

Download URL slimmer-0.1.30.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
55c4494ada8ebfd16b6bd673b76df7441ac5cc2b3eae3166c0abe2016230e76b
BLAKE2b-256 checksum
How to use checksums
9b8aea0e2f572e9dd4431a772e6c6bf427e4513b2f88fb7430907b19327c1335
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.30 This release

1 release file

0.1.29

2 release files

0.1.28

2 release files

0.1.27

2 release files

0.1.26

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page