Skip to main content

python-diminuendo - HTML minifier

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

Install

$ pip install python-diminuendo

Usage

TODO

HTML minification

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

Development

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

Test the package:

$ python -m unittest discover

Automatic testing in various environments:

$ tox

Release

Use bumpr to release the package:

$ bumpr -b -m
[...]
$ python setup.py sdist bdist_wheel upload

Project

Other projects

License

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

Metadata

Release files for python-diminuendo 0.1.1

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

Source distribution (sdist)

Source distribution for python-diminuendo 0.1.1
File Size Uploaded
python-diminuendo-0.1.1.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-diminuendo 0.1.1
File Interpreter ABI Platform
python_diminuendo-0.1.1-py2-none-any.whl Python 2 none any Details

Total release size: 12.8 kB

Release files / python-diminuendo-0.1.1.tar.gz

Download URL python-diminuendo-0.1.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d8808b04ec35f04b55baab251ea783e645a566d457f51dc3206e7036653773c8
BLAKE2b-256 checksum
How to use checksums
07160cf816790c85a3c16e7ff2b50e3b861fb4ac702ee19ab120e16fc1ac6e26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_diminuendo-0.1.1-py2-none-any.whl

Download URL python_diminuendo-0.1.1-py2-none-any.whl
Size 6.7 kB
Tags Python 2
SHA-256 checksum
How to use checksums
7bf6b8f35c889c9b129248c362bb5610397f347805938c4b07d6019efdabba95
BLAKE2b-256 checksum
How to use checksums
fead3dcdf3491831fec890994d672d6de210aaacf5a36904436a944d5319c8e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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