Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

YUI Compressor packaged for Python

Project Description

YUI Compressor is a JavaScript and CSS minifier written in Java. This package bundles the YUI Compressor JAR file to ease its use in Python projects. Note that you still need to have Java Runtime Environment installed.

For instance, you may use this package with buildout. First, create the buildout.cfg file:

[buildout]
parts = yuicompressor

[yuicompressor]
recipe = zc.recipe.egg
eggs = yuicompressor

Next, download buildout bootstrap script and run the buildout itself:

$ wget http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py
$ python bootstrap.py
Creating directory 'bin'.
Creating directory 'parts'.
Creating directory 'develop-eggs'.
Generated script 'bin/buildout'.
$ bin/buildout
Installing yuicompressor.
Getting distribution for 'yuicompressor'.
Got yuicompressor 2.4.6.
Generated script 'bin/yuicompressor'.

The yuicompressor script is ready to use:

$ bin/yuicompressor
Usage: java -jar yuicompressor-x.y.z.jar [options] [input file]

Global Options
-h, --help                Displays this information
--type <js|css>           Specifies the type of the input file
--charset <charset>       Read the input file using <charset>
--line-break <column>     Insert a line break after the specified column number
-v, --verbose             Display informational messages and warnings
-o <file>                 Place the output into <file>. Defaults to stdout.

JavaScript Options
--nomunge                 Minify only, do not obfuscate
--preserve-semi           Preserve all semicolons
--disable-optimizations   Disable all micro optimizations

If no input file is specified, it defaults to stdin. In this case, the 'type'
option is required. Otherwise, the 'type' option is required only if the input
file extension is neither 'js' nor 'css'.

You could then integrate this with a package that relies on the compressor, e.g. django-compress and worry no more.

User-level installation with easy_install does make sense even for standalone use, e.g. having yuicompressor in your PATH.

Versions

Version X.Y.Z of this package will bundle the corresponding version of the compressor.

Changelog

2.4.7

  • Updated yuicompressor.jar to 2.4.7
  • yuicompressor does not require setuptools anymore: it’s also installable with pure distutils. However, the executable script in the pure distutils installation does not have the same name as in the setuptools installation: it is named yuicompressor_run.py instead of yuicompressor due to import restriction and windows shebang incompatibility.
  • Added a run method in the yuicompressor module allowing us to run the tool with custom arguments from python source code.
  • Added a changelog (CHANGES file)
  • Added maintainer information; changed the package URL to point to the associated bitbucket repository
  • Linux-style end-of-line characters
  • Added more classifiers and platform information

2.4.6.1

  • Include *.jar in manifest

2.4.6

  • Update yuicompressor.jar to 2.4.6
  • Update contact email

2.4.2

  • Initial release
Release History

Release History

This version
History Node

2.4.8

History Node

2.4.7

History Node

2.4.6.1

History Node

2.4.6

History Node

2.4.2

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
yuicompressor-2.4.8.tar.gz (754.4 kB) Copy SHA256 Checksum SHA256 Source Sep 24, 2013
yuicompressor-2.4.8.zip (758.1 kB) Copy SHA256 Checksum SHA256 Source Sep 24, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting