The cssmin package is used to minify css files.
cssmin is a Python port of the YUI CSS Compressor. It is used to minify css files, which helps improve web application performance by reducing page load times.
pip install cssmin
The package provides a command line interface as well as Python functions.
import cssmin minified = cssmin.cssmin(open('style.css').read()) print minified
cssmin --wrap 1000 < style.css > style.min.css
Thats it, nice and sweet.
blog comments powered by Disqus