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@mainOr clone the repository and install locally:
git clone https://github.com/milesbarr/minifier.git
cd minifier
pip install .Minify a file:
python -m minifier page.html minified.htmlMinify a file:
from minifier import minify_file
minify_file("page.html", "minified.html")This project is licensed under the MIT License.