A Python tool for minifying website assets by removing unnecessary whitespace, comments, and other redundant content while preserving functionality. Ideal for web developers looking to optimize site performance.
- Minifies common web file formats: HTML, CSS, JSON, and XML
- Preserves full functionality while reducing file size
- Simple command-line interface
- Can be used as a Python library
- Fast and lightweight, with minimal dependencies
- HTML (
.html
,.htm
,.xhtml
) - CSS (
.css
) - JSON (
.json
,.webmanifest
) - XML (
.xml
,.rss
,.atom
,.svg
)
Install directly from GitHub:
pip install git+https://github.com/milesbarr/minifier@main
Or clone the repository and install locally:
git clone https://github.com/milesbarr/minifier.git
cd minifier
pip install .
Minify a file:
python -m minifier -i input.html -o output.html
Minify a file:
from minifier import minify_file
minify_file("input.html", "output.html")
This project is licensed under the MIT License.