csscompressor
A python port of YUI CSS Compressor
What it is and what it does
csscompressor is a Python port of the YUI CSS Compressor, a tool that reduces CSS file size by stripping whitespace, comments, and other redundant syntax while preserving functionality. It has no runtime dependencies and can be used either as a Python library via the `compress()` function or as a command-line utility.
The package passes all original YUI Compressor unit tests, making it a faithful implementation of that algorithm. However, it is no longer actively maintained—the last release was 2017-11-26 and the repository shows no commits since 2023-08-07. It remains in production-stable status but receives no updates for modern CSS features or security issues.
Use it for:
- Minify CSS files during a build pipeline to reduce stylesheet download size in web applications
- Compress inline CSS in HTML templates or dynamically generated stylesheets before serving to browsers
- Batch-process CSS codebases using the YUI algorithm as part of asset optimization
- Integrate CSS compression into Python-based static site generators or build tools
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Compresses CSS by removing unnecessary whitespace and comments, following the YUI CSS Compressor algorithm.
No, unless you have a specific requirement for the YUI CSS Compressor algorithm or an existing dependency on this exact package. The project is abandoned (last release 2017-11-26, no commits since 2023-08-07), has high install friction (source-only), and the maintenance status is abandoned. If you need CSS compression, evaluate actively maintained alternatives.
Install
csscompressor on PyPI
pip
pip install csscompressoruv
uv add csscompressorpoetry
poetry add csscompressorInstalling csscompressor
Before you install
High install friction due to source-only distribution (no wheels). Package is abandoned—last release was 2017-11-26, with no maintenance activity since 2023-08-07. Use only if you have a specific dependency on this exact implementation.
License in practice
Published under BSD license (permissive), which allows commercial and private use with minimal restrictions. No licensing barrier to adoption.
Quickstart
pip install csscompressor
from csscompressor import compress
result = compress('your css { content: "!"; }')
print(result) # 'your css{content:"!"}'
# Or from command line:
# python3 -m csscompressor --help
Verify before relying
- Whether the package works reliably on Python versions beyond 3.3+ (classifiers list 2.6, 2.7, 3 but no upper bound specified)
- Current compatibility with modern CSS syntax and edge cases not covered by original YUI test suite
- Whether source-only distribution causes build failures on platforms without a C compiler
- How actively maintained alternatives compare in performance and feature coverage
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,183 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 948,510/month — #4,662 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: csscompressor-0.9.5.tar.gz
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
cssminCompresses CSS files by removing unnecessary…
unclear · top 15,000 on PyPI
rcssminRCSSmin minifies CSS by removing spaces,…
permissive · top 5,000 on PyPI
htmlmin2Minifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
htmlminMinifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
django-compressorDjango Compressor combines, minifies, and…
permissive · top 5,000 on PyPI
webassetsMerges and compresses JavaScript and CSS files…
permissive · top 15,000 on PyPI
jsminMinifies JavaScript code by removing…
permissive · top 5,000 on PyPI
mkdocs-minify-pluginMinifies HTML, JavaScript, and CSS files in…
permissive · top 5,000 on PyPI
minify-htmlMinifies HTML, JavaScript, and CSS in a single…
permissive · top 5,000 on PyPI
Flask-MinifyFlask extension that automatically minifies…
permissive · top 15,000 on PyPI