css-html-js-minify
CSS HTML JS Minifier
What it is and what it does
css-html-js-minify is a command-line and Python library tool that reduces the size of CSS, HTML, and JavaScript files by removing unnecessary whitespace, comments, and redundant syntax. It works on single files or entire folders, using async multiprocessing for batch operations. The tool is cross-platform, has no runtime dependencies, and can output minified files with optional features like SHA1 hashing for cache-busting, gzip compression, and file watching for automatic re-compression on changes.
You can use it either as a standalone command-line utility (e.g., `css-html-js-minify.py /path/to/project/static/`) or import its functions directly in Python code to minify strings or files programmatically. It handles Unicode and UTF-8 correctly, sorts CSS properties alphabetically to help identify duplicates, and can execute arbitrary commands before and after minification. However, the project has been abandoned since 2018 and is no longer actively maintained, so it may not handle modern JavaScript standards or receive bug fixes.
Use it for:
- Compress static assets in a web project before deploying to production to reduce bandwidth and load times.
- Batch-process an entire folder of CSS, HTML, and JS files with a single command, optionally adding cache-busting hashes to filenames.
- Integrate minification into a build pipeline by calling Python functions directly from your build script.
- Watch a folder for changes and automatically re-minify files during development, though with a minimum 60-second interval.
- Generate gzipped versions of minified CSS and JS files for servers that support gzip content encoding.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Minifies CSS, HTML, and JavaScript files or folders to reduce file size for production deployment, with optional hashing, gzipping, and file watching.
Yes, if you need a lightweight, dependency-free minifier for legacy or simple web projects. No, if you require active maintenance, modern JavaScript support (ES6+), or ongoing bug fixes—the project is abandoned as of 2018. Consider alternatives if your codebase relies on contemporary JavaScript features or if you need assurance of compatibility with current Python and web standards.
Install
css-html-js-minify on PyPI
pip
pip install css-html-js-minifyuv
uv add css-html-js-minifypoetry
poetry add css-html-js-minifyInstalling css-html-js-minify
Before you install
No runtime dependencies and low install friction. However, the project is marked abandoned with the last commit in June 2023 and no releases since April 2018, so maintenance and bug fixes are not expected.
License in practice
Licensed under GPL-3, LGPL-3, and MIT. The copyleft treatment means you must comply with GPL/LGPL terms if you distribute modified versions or link the code into derivative works; MIT is permissive. Review your use case against these obligations.
Quickstart
pip install css-html-js-minify
from css_html_js_minify import css_minify, js_minify, html_minify
minified_css = css_minify('body {width: 50px;}')
minified_js = js_minify('var i = 1; i += 2;')
minified_html = html_minify(' <p>hello</p> ')
Requires Python 3.6 or later.
Verify before relying
- Whether ES6/ES7 JavaScript minification is reliable enough for modern codebases, given the fact sheet notes future JavaScript support is orphan.
- Current compatibility with Python versions beyond 3.6, since the project is abandoned and has not been tested against recent Python releases.
Package facts
| License | GPL-3 LGPL-3 MIT (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,044 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 294,884/month — #7,938 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: css_html_js_minify-2.5.5-py2.py3-none-any.whl
Keywords: python3
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
Flask-MinifyFlask extension that automatically minifies…
permissive · top 15,000 on PyPI
htmlmin2Minifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
rcssminRCSSmin minifies CSS by removing spaces,…
permissive · top 5,000 on PyPI
minify-htmlMinifies HTML, JavaScript, and CSS in a single…
permissive · top 5,000 on PyPI
jsbeautifierBeautifies, unpacks, and deobfuscates…
permissive · top 5,000 on PyPI
htmlminMinifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
mkdocs-minify-pluginMinifies HTML, JavaScript, and CSS files in…
permissive · top 5,000 on PyPI
cssminCompresses CSS files by removing unnecessary…
unclear · top 15,000 on PyPI
django-htmlminMinifies HTML by removing whitespace and…
permissive · top 5,000 on PyPI
cssbeautifierBeautifies, unpacks, and deobfuscates CSS code…
permissive · top 5,000 on PyPI