{ "info": { "author": "Ruslan Spivak", "author_email": "ruslan.spivak@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities" ], "description": "::\n\n ____ ____ _ __ __ __ __ ___ _____\n / ___| _ \\ / \\ | \\/ | \\/ |_ _|_ _|\n | | | |_) | / _ \\ | |\\/| | |\\/| || | | |\n | |___| _ < / ___ \\| | | | | | || | | |\n \\____|_| \\_\\/_/ \\_\\_| |_|_| |_|___| |_|\n\n\nWhat the heck is this?\n======================\n\n**Crammit** is a small tool that provides both CSS and JavaScript\nconcatenation, compression and some other asset management related\ngoodies. If you've heard of Jammit for Rails then you can think of it\nas my attempt to provide a similar simple version in Python.\n\nInstallation\n------------\n\n::\n\n $ [sudo] pip install crammit\n\nIf you're adventurous you can install a bleeding edge version from\nthe git master branch:\n\n::\n\n $ [sudo] pip install git+https://github.com/rspivak/crammit.git#egg=crammit\n\nTo install in development mode\n\n::\n\n $ git clone https://github.com/rspivak/crammit.git\n $ python setup.py develop\n\nPut it through its paces\n------------------------\n::\n\n $ crammit -c assets.yaml\n\nSee below about configuration file format and parameters\n\nConfiguration\n-------------\n\nUse YAML file to configure Crammit.\nHere is a sample configuration file.\n\n::\n\n output: assets # directory path relative to the current directory\n fingerprint: true # add sha1 hash to the output file name\n\n js_minifier: ... # optionally use a minifier other than slimit.\n # expects a shell command that uses stdin/stdout.\n js_minifier_options: # options dictionary to configure JS minifier\n mangle: True\n mangle_toplevel: True\n\n javascript:\n # 'common' is a bundle name, output file will have prefix 'common'\n common:\n - static/js/application.js\n - static/js/vendor/*.js\n utils:\n # paths are relative to the current directory\n - static/js/utils.js\n\n css:\n base:\n # you can use Unix shell-style wildcards in file names\n - static/css/*.css\n\n\n- **output** - specifies relative path of an output directory where allgenerated files will be put.\n- **fingerprint** - either true or false. If true then SHA1 hash will be added to output bundle file names. The hash is calculated on concatenated original files before minification and gzip compressionis applied.\n\nEvery bundle will output 3 files. Let's check out the output of\nthe javascript *common* bundle.\n\n- common-{sha1}.js - concatenated original files\n- common-{sha1}.min.js - concatenated and minified files\n- common-{sha1}.min.js.gz - concatenated, minified, and gzipped files\n\nInformation file\n----------------\nCrammit produces a bundle information file in {output}/assetsinfo.yaml\nthat contains different details about all generated bundles.\nThe information includes SHA1 fingerprint (if enabled) for a bundle,\noutput file names and their corresponding sizes in bytes.\n\n- *raw* - concatenated\n- *min* - concatenated and minified\n- *gz* - concatenated, minified, and gzipped\n\n::\n\n css:\n base:\n files:\n - static/css/test1.css\n - static/css/test2.css\n fingerprint: 71fe4cba05a1a51023c6af4c4abf9c47ab21e357\n output:\n gz: base-71fe4cba05a1a51023c6af4c4abf9c47ab21e357.min.css.gz\n min: base-71fe4cba05a1a51023c6af4c4abf9c47ab21e357.min.css\n raw: base-71fe4cba05a1a51023c6af4c4abf9c47ab21e357.css\n size:\n gz: 108\n min: 235\n raw: 277\n javascript:\n common:\n files:\n - static/js/application.js\n - static/js/vendor/vendor1.js\n - static/js/vendor/vendor2.js\n fingerprint: 6493b619c73c49ce1f4dfe2c31d41902e98acaee\n output:\n gz: common-6493b619c73c49ce1f4dfe2c31d41902e98acaee.min.js.gz\n min: common-6493b619c73c49ce1f4dfe2c31d41902e98acaee.min.js\n raw: common-6493b619c73c49ce1f4dfe2c31d41902e98acaee.js\n size:\n gz: 56\n min: 41\n raw: 50\n utils:\n files:\n - static/js/utils.js\n fingerprint: c3ef63280b954d99e8b13fc11ea3031caee77f1a\n output:\n gz: utils-c3ef63280b954d99e8b13fc11ea3031caee77f1a.min.js.gz\n min: utils-c3ef63280b954d99e8b13fc11ea3031caee77f1a.min.js\n raw: utils-c3ef63280b954d99e8b13fc11ea3031caee77f1a.js\n size:\n gz: 42\n min: 22\n raw: 24\n\nAcknowledgments\n---------------\n- CSS minification - `cssmin `_\n- Stole nice idea of bundle information file - `Squeezeit `_\n- JavaScript minifier - `SlimIt `_\n\nLicense\n-------\nThe MIT License (MIT)\n\nChange History\n==============\n0.5 (2012-06-24)\n----------------\n- Run custom JS minifier with *js_minifier* option\n- Don't minify files that contain '.min' in their file name\n- Add semicolon between merged JS files for safety\n\n0.4 (2012-03-17)\n----------------\n- Added *js_minifier_options* configuration directive that specifies\n named parameters that are passed to the underlying JS\n minifier to configure it\n\n0.3 (2012-03-12)\n----------------\n- *files* option in assetsinfo.yaml that lists files processed to create a bundle\n- Python 2.6 support\n\n0.2 (2012-02-12)\n----------------\n- Public release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rspivak/crammit.git", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "crammit", "package_url": "https://pypi.org/project/crammit/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/crammit/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/rspivak/crammit.git" }, "release_url": "https://pypi.org/project/crammit/0.5/", "requires_dist": null, "requires_python": null, "summary": "Asset packaging library. Concatenates, Minifies, and Compresses CSS and JavaScript", "version": "0.5" }, "last_serial": 788506, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "43a417e17da536390fc72cdaba44bdd7", "sha256": "f67888a100427e64798ed002c9efbbaf14da8fb98215cf9a310997bb184ba866" }, "downloads": -1, "filename": "crammit-0.2.zip", "has_sig": false, "md5_digest": "43a417e17da536390fc72cdaba44bdd7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12225, "upload_time": "2012-02-12T08:10:31", "url": "https://files.pythonhosted.org/packages/a5/28/64dee04b96671dad918e3225b4a546f49a49bdd42bdf9ce1806dd91a1318/crammit-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "084f69dd3e8758f041f4b05fc796e3c7", "sha256": "36ae8d1b1208c0b48a1c8ee67200a79c1b45294444b7e5509b5b008d7b242ea3" }, "downloads": -1, "filename": "crammit-0.3.zip", "has_sig": false, "md5_digest": "084f69dd3e8758f041f4b05fc796e3c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13183, "upload_time": "2012-03-12T05:41:54", "url": "https://files.pythonhosted.org/packages/91/e5/3f97eb73a3fcb0c4acd58123b32d2262f0dba5e1506c4b6a723875bc257f/crammit-0.3.zip" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "8d1c1f530a9d47f78e9bab8ca827e118", "sha256": "5d035ce0fff85b499b6732d07344dbcbccf29a66f6ef03b77b704375031118b5" }, "downloads": -1, "filename": "crammit-0.4.zip", "has_sig": false, "md5_digest": "8d1c1f530a9d47f78e9bab8ca827e118", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13566, "upload_time": "2012-03-17T06:00:35", "url": "https://files.pythonhosted.org/packages/83/c5/e3d20f343aef0582db90b547e1d6003376fc968c0caa3ef9f553de8737a1/crammit-0.4.zip" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "941ff4627fc59042c761b6ff29e6bcf3", "sha256": "b0042a4d67b24bde219f9cfba978060559a58d4270b454dca870ab70ac42b923" }, "downloads": -1, "filename": "crammit-0.5.zip", "has_sig": false, "md5_digest": "941ff4627fc59042c761b6ff29e6bcf3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14302, "upload_time": "2012-06-25T02:19:51", "url": "https://files.pythonhosted.org/packages/d6/0b/6555be38feadacbfb3e9bb0c6bf0f67101ec2de87f3622298d3b5b8c89ac/crammit-0.5.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "941ff4627fc59042c761b6ff29e6bcf3", "sha256": "b0042a4d67b24bde219f9cfba978060559a58d4270b454dca870ab70ac42b923" }, "downloads": -1, "filename": "crammit-0.5.zip", "has_sig": false, "md5_digest": "941ff4627fc59042c761b6ff29e6bcf3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14302, "upload_time": "2012-06-25T02:19:51", "url": "https://files.pythonhosted.org/packages/d6/0b/6555be38feadacbfb3e9bb0c6bf0f67101ec2de87f3622298d3b5b8c89ac/crammit-0.5.zip" } ] }