skillfed

css-html-js-minify

CSS HTML JS Minifier

css-html-js-minify v2.5.5 294.9K downloads/30d#7,938 on PyPI216
Copyleft license GPL-3 LGPL-3 MIT Abandoned released

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-minify

uv

uv add css-html-js-minify

poetry

poetry add css-html-js-minify

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Other EnvironmentIntended Audience :: DevelopersIntended Audience :: Other AudienceLicense :: OSI Approved :: GNU General Public License (GPL)License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Natural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.6Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development

Tags

css html js minifierweb asset compressionminify css javascript htmlproduction file optimizationbatch minify static filesgzip and hash web filesasync minifier command line
web-assetsbuild-toolabandoned

More Software Development packages