skillfed

csscompressor

A python port of YUI CSS Compressor

csscompressor v0.9.5 948.5K downloads/30d#4,662 on PyPI92
Permissive license BSD Abandoned released

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 csscompressor

uv

uv add csscompressor

poetry

poetry add csscompressor

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Software Development :: Build ToolsTopic :: Text Processing :: GeneralTopic :: Utilities

Tags

css minificationcss compressionremove css whitespaceyui compressor pythoncss optimizerstylesheet minifiercss build tool
css-minificationabandonedlegacy

More Utilities packages