Skip to main content
Help us improve Python packaging – donate today!

A generic HTML minifier for python

Project Description

This is a generic HTML minifier NOT using regular expressions. This minifier is fully HTML5 compatible.

The name is coming from the Harry Potter books and is an incantation that forces objects to shrink

This project was started because of the lack of a maintained HTML minifier not using complex regexp. This project uses beautifulsoup to navigate the HTML flow.

Testing Status Documentation Status license BSD 3-Clause


$ pip install python-diminuendo



HTML minification

>>> from diminuendo import htmlmin
>>> html = """<html>
        <title>Hello World!</title>
        <p>Good morning</p>
>>> minified = htmlmin(html)
>>> print minified
'<html><head><title>Hello World!</title></head><body><p>Good morning</p></body></html>'


Add a minification test

To add a minification test, simply add the html code as test_name.html and its minified version as test_name-minified.html in test/html.


Test the package:

$ python -m unittest discover

Automatic testing in various environments:

$ tox


Use bumpr to release the package:

$ bumpr -b -m
$ python sdist bdist_wheel upload

Other projects


python-diminuendo is published under a BSD 3-clause license, see the LICENSE file distributed with the project.

Release history Release notifications

This version
History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
python_diminuendo-0.1.1-py2-none-any.whl (6.7 kB) Copy SHA256 hash SHA256 Wheel 2.7 Mar 19, 2015
python-diminuendo-0.1.1.tar.gz (6.1 kB) Copy SHA256 hash SHA256 Source None Mar 19, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page