{ "info": { "author": "Jer\u00f3nimo Jos\u00e9 Albi", "author_email": "albi@wienfluss.net", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Topic :: Utilities" ], "description": "========\n Shrink\n========\n\nShrink is a command for concatenating and compressing css stylesheets and\njavascript files making them smaller.\nShrinking (or minifying) these files reduces the number of request that are\nmade after a page load and also the size of these requests.\n\nThis command depends on `YUI Compressor`_ for compression, and runs with\nPython 2.5 and above, including Python 3.\n\nInstall\n=======\n\nShrink can be easily installed from pypi by running::\n\n $ pip install shrink\n\nAfter install is good to display script information and options::\n\n $ shrink -h\n\n.. _YUI Compressor: http://developer.yahoo.com/yui/compressor/\n\nConfig file\n===========\n\n``INI`` style files are used to know which files will be minified, set some\nglobal options and also to know which files will be joined before\nminification.\n\nA good starting point to get familiar with Shrink config file format is to\nread the example shrink config file. To create an example file run::\n\n $ shrink --example-cfg\n\nThis command creates a file called ``example_shrink.cfg`` in current folder.\n\nConfig file format\n==================\n\nConfig file has a section for each individual file that can be generated,\nand on top it also has a special section called ``DEFAULT`` where global\noptions are defined.\n\nGlobal ``DEFAULT`` options:\n\n * ``base_dir`` defines a base directory used as prefix to find static files.\n This value can be referenced in any other section using the python variable\n notation ``%(base_dir)s``.\n * ``hash_dir`` defines a folder where ``shrink.sha1`` file is stored. See\n `Shrink hash file`_ for more info. By default, this file is stored in the\n same folder where shrink config file is located.\n * ``arg.*`` defines default values for some command line argumens. Supported\n arguments are ``arg.java_bin`` and ``arg.yui_jar``.\n The values given here are overriden by the ones given during runtime as\n command line arguments.\n\nEach file section has some options that are used during join, compression and\nhashing of a file. These file section options are:\n\n * ``source_directory`` value defines the folder where file(s) listed in\n ``source_files`` are located.\n * ``source_files`` value can be a single file name, or a list of file names.\n When a list of names is given, each file in list is concatenated (from top\n to down) into a single file before compression.\n * ``destination_directory`` value sets output directory for the minified file\n By default minified file is generated in source directory.\n * ``destination_file`` value is the name for the minified file.\n * ``hash`` is a boolean value. When it is true destination file is included\n during shrink hash generation. See `Shrink hash file`_.\n * ``compress`` is a boolean value. Destination file is not compressed when\n this value is false. By default compression is done for destination\n files.\n This option is useful when is desirable to join many files without\n compressing them because they are already compressed.\n\nFor example, a section for minifying a file called ``sample-file.js`` could\nbe written as::\n\n [sample-single-file-js]\n source_directory = %(base_dir)s/js\n destination_file = sample-file.min.js\n source_files = sample-file.js\n\nFinal minified file name would be ``sample-file.min.js``.\n\nMany files can also be specified to be joined into a single file before\ncompression by writing a section like::\n\n [sample-multiple-file-css]\n source_directory = %(base_dir)s/css\n destination_file = sample-multiple-file.min.css\n source_files =\n sample-file1.css\n sample-file2.css\n sample-file3.css\n\nGenerated file name is given by ``destination_file`` value.\n\nMinimize css and js files\n=========================\n\nTo minify all files, run::\n\n $ shrink -f example_shrink.cfg all\n\nThis will use ``yuicompressor.jar`` and the ``example_shrink.cfg`` file in\ncurrent directory to compress all files.\n\nIn case that minification is not desired for all files, is also possible to\nminify individual files, or a group of files (See `Section groups`_), by\nusing the name(s) of each section instead of ``all`` as argument.\n\nTo list available sections, run::\n\n $ shrink -f example_shrink.cfg -l\n\nSection groups\n--------------\n\nInstead of running script with ``sample-single-file-js`` and\n``sample-multiple-file-css`` as arguments is possible to define a group like::\n\n [sample-group]\n group =\n sample-single-file-js\n sample-multiple-file-css\n\nAnd then run minifier script with ``sample-group`` as the only parameter.\n\nShrink hash file\n----------------\n\nAfter minification Shrink can create a file containing a SHA1 hash. The file\nis created when at least one section in config file has ``hash = true``. Hash\nis created using the contents of all destination files in these sections.\n\nThis is useful to know when some files changed, and to reload static css and\njavascript files without using a timestamp or version number.\nSometime can be desirable to reload modified static files without increasing\napplication version. In these cases the hash can be used as request parameter\ninstead of version number.\n\nDeployment notes\n================\n\nIt can happen your application stop working or have unespected results when\nit is deployed with minified css and javascript files.\nMany times some of these problems are is easy avoid by having present the\nfollowing notes during ``shrink.cfg`` setup:\n\n * The order of the source files in each config section must be the same as\n the one in your HTML templates.\n * CSS files normally contains URLs which are relative to the location of\n the file where they are declared. So for these cases the location for\n destination file must be the same as the one for source files.\n Some javascript files might define some path or URL that might also be\n relative to a file location.\n * Check that all files wich are NOT minified are being included in your\n HTML template.\n\n\n=========\nChangelog\n=========\n\n1.1.1 - 2012-09-21\n==================\n\n * Setup argument use_2to3 is now enabled only for python 3 series\n * Added ``Deployment notes`` to README file\n * Added read permissions to generated files for group and others\n\n1.1.0 - 2012-07-31\n==================\n\n * Added python 3 support\n * Updated documentation\n * Added initial files for unit testing\n\n1.0.1 - 2012-07-19\n==================\n\n * Added --hash-dir argument to allow changing hash file dir during runtime\n * Added ``compress`` INI file option to avoid compressing destination file\n * Added --example-cfg argument to create an example_shrink.cfg file in\n current folder\n\n1.0.0 - 2012-07-11\n==================\n\n * Added --version argument\n * Added SHA1 hashing support (``hash = true`` in any file section)\n * Added --hash-all argument to generae SHA1 hash using all files contents", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/jeronimoalbi/shrink", "keywords": "minify javascript css yuicompressor", "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "shrink", "package_url": "https://pypi.org/project/shrink/", "platform": "OS Independent", "project_url": "https://pypi.org/project/shrink/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/jeronimoalbi/shrink" }, "release_url": "https://pypi.org/project/shrink/1.1.1/", "requires_dist": null, "requires_python": null, "summary": "Command line tool for minification of css and javascript files", "version": "1.1.1" }, "last_serial": 767712, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "400430504025c732ca9069a19eff8f6a", "sha256": "280be89a00550926d9669ff7328e564a856c2af133e0930b7f3e8e54959c00f5" }, "downloads": -1, "filename": "shrink-1.0.tar.gz", "has_sig": false, "md5_digest": "400430504025c732ca9069a19eff8f6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9206, "upload_time": "2012-07-11T16:13:25", "url": "https://files.pythonhosted.org/packages/4b/ee/23a0eb4dda686de6363a434ac4930dd5e250fb173b9b9a5103096420c1bc/shrink-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "19a82f119accb07c38d8d3302451c895", "sha256": "622f3829741c3690525b944670e34e88f245c1840173005b0ca279e31e2dadab" }, "downloads": -1, "filename": "shrink-1.0.1.tar.gz", "has_sig": false, "md5_digest": "19a82f119accb07c38d8d3302451c895", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12326, "upload_time": "2012-07-19T11:48:43", "url": "https://files.pythonhosted.org/packages/83/d3/0e49b82e479b789deaf66ff8dbb7738c616bf01221c633367319261eeb49/shrink-1.0.1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "8acac7b397f45af8618375035d0a2624", "sha256": "571ae0457bbb45811e5c378b9de7f2cb04b2871be0adca6fe99aac4c59d9979b" }, "downloads": -1, "filename": "shrink-1.1.tar.gz", "has_sig": false, "md5_digest": "8acac7b397f45af8618375035d0a2624", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14036, "upload_time": "2012-07-31T09:17:56", "url": "https://files.pythonhosted.org/packages/a2/1a/c7f6b2d907aa6d1d0576383f571573f234d4f33ed74bac20d2b93985e259/shrink-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "69536db3b58334ab0365f25cab0b8461", "sha256": "03b2f59ae13e6b7f1db05416b0fe3b2ffa9443558427e739231e9d081a06077d" }, "downloads": -1, "filename": "shrink-1.1.1.tar.gz", "has_sig": false, "md5_digest": "69536db3b58334ab0365f25cab0b8461", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14462, "upload_time": "2012-09-21T13:47:13", "url": "https://files.pythonhosted.org/packages/9e/0e/30dac72b275cbba249ed4ceab7cec7bd53c915deec7aaa170141f79f43a9/shrink-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "69536db3b58334ab0365f25cab0b8461", "sha256": "03b2f59ae13e6b7f1db05416b0fe3b2ffa9443558427e739231e9d081a06077d" }, "downloads": -1, "filename": "shrink-1.1.1.tar.gz", "has_sig": false, "md5_digest": "69536db3b58334ab0365f25cab0b8461", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14462, "upload_time": "2012-09-21T13:47:13", "url": "https://files.pythonhosted.org/packages/9e/0e/30dac72b275cbba249ed4ceab7cec7bd53c915deec7aaa170141f79f43a9/shrink-1.1.1.tar.gz" } ] }