Skip to main content

Python wrapper for Uglify-JS library.

Project description

UgliPyJs is a port of the uglifier gem for python. It wraps the UglifyJS minification tool allowing you to minify your Javascript files from your Python code.

Install

$ pip install uglipyjs

Usage

To minify your javascript code:

import uglipyjs
js = open('blah.js','r').read()
uglipyjs.compile(js)

You can also minify with source map:

import uglipyjs
js = open('blah.js','r').read()
uglipyjs.compile_with_map(js)

If you need to override the defaults pass a dict of options as a second parameter to the compile function:

import uglipyjs
js = open('blah.js','r').read()
uglipyjs.compile(js,{'mangle':False})

License

Copyright 2012 Will McKenzie

UgliPyJs is licensed under the MIT License, please see the LICENSE file for more details.

Project details


Release history Release notifications

History Node

0.2.5

History Node

0.2.4

This version
History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
UgliPyJS-0.2.3.tar.gz (51.5 kB) Copy SHA256 hash SHA256 Source None Jan 14, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page