{ "info": { "author": "William Mayor", "author_email": "jinjerly@williammayor.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Topic :: Software Development :: Code Generators" ], "description": "# jingerly\n[![Build Status](https://travis-ci.org/WilliamMayor/jingerly.svg?branch=master)](https://travis-ci.org/WilliamMayor/jingerly)\n[![Latest Docs](https://readthedocs.org/projects/jingerly/badge/?version=latest)](http://jingerly.readthedocs.org/en/latest/)\nProject templating using Jinja2.\n\nEasily create a blank project skeleton from a project template using the following features:\n\n- Jinja2 templated files\n- Templated file/folder names\n- Download files from the Internet\n- Copy local files into the project\n- Run custom scripts before and after creation\n\n## Usage\n\nCreate a new project directory from a project template:\n\n $ jingerly ~/templates/web ~/projects/next-big-thing\n\nThis copies over all of the files in `~/templates/web` and puts them in `~/projects/next-big-thing`.\n\n### With Template Variables\n\nLet's say your project template has a template `README.md` file that looks like this (using the Jinja2 templating language):\n\n # {{ project_name }}\n {{ short_desc }}\n\nYou can fill in those variables like this:\n\n $ jingerly ~/templates/web ~/projects/next-big-thing \\\n --project_name=nbt \\\n --short_desc=\"It's going to be awesome\"\n\nYou'll see a file in `~/projects/next-big-thing/README.md` that looks like this:\n\n # nbt\n It's going to be awesome\n\njingerly automatically defines the variables `IN` and `OUT` for you to use in your templates. `IN` is the template directory you provide (`~/templates/web`) and `OUT` is the output directory (`~/projects/next-big-thing`).\n\n### With Variable File/Folder Names\n\nThe file and folder names are run through Jinaj2 too. So you can have a directory template tree that looks like this:\n\n web/\n {{project_name}}/\n {{project_name}}.py\n README.md\n\nThen you can run the previous `jingerly` command and see this:\n\n next-big-thing/\n nbt/\n nbt.py\n README.md\n\n### With Interactivity\n\nIf you don't want to list your variable names and values on the command line you can fill them in interactively:\n\n $ jingerly ~/templates/web ~/projects/next-big-thing --interactive\n Value for project_name (leave blank to ignore): nbt\n Value for short_desc (leave blank to ignore): It's going to be awesome\n\n### With Pre-Defined Variable Values\n\nIf you create a file called `jingerly.env` in your project template then jingerly will automatically pick up the values you define inside it. It's read in as a Python file so your variable definitions must be in the Pythyon syntax.\n\n web/\n {{project_name}}/\n {{project_name}}.py\n README.md\n jingerly.env\n\n`jingerly.env`:\n\n project_name = 'nbt'\n short_desc = \"It's going to be awesome\"\n\n### With Files Downloaded from the Internet\n\nYou might want to download a file when you create a new project, so jingerly adds a download filter into Jinja2. Let's say you want the latest version of jQuery so you create a template file called `jquery.js` in your project template:\n\n web/\n {{project_name}}/\n {{project_name}}.py\n static/\n jquery.js\n README.md\n jingerly.env\n\n`jquery.js`:\n\n {{ \"http://code.jquery.com/jquery-latest.min.js\" | download }}\n\n### With Files Copied Locally\n\nYou might want to copy a file in from somewhere else.\n\n gitignore\n web/\n .gitignore\n {{project_name}}/\n {{project_name}}.py\n static/\n jquery.js\n README.md\n jingerly.env\n\n`.gitignore`:\n\n {{ OUT + \"/../gitignore\" | copy }}\n\n### With Custom Scripts\n\njingerly also lets you define some scripts to be run when you create a new project. Create a file called `jingerly.pre` or `jingerly.post` in your project template and make it executable.\n\n gitignore\n web/\n .gitignore\n {{project_name}}/\n {{project_name}}.py\n static/\n jquery.js\n README.md\n jingerly.env\n jingerly.post\n\n`jingerly.post`:\n\n #! /bin/bash\n\n virtualenv {{ OUT }}/venv\n . {{ OUT }}/venv/bin/activate\n pip install --upgrade pip\n pip install flask\n pip freeze > {{ OUT }}/requirements.txt\n\nThis will result in:\n\n next-big-thing/\n .gitignore\n nbt/\n nbt.py\n static/\n jquery.js\n README.md\n venv/\n requirements.txt\n\nThe scripts are run through Jinja2 before they're executed. `jingerly.pre` scripts will run after the template directory has been copied over into the output directory but before any templating has occurred. `jingerly.post` scripts will be run after Jinja2 has finished rendering the new project.\n\n## Installation\n\nThe easiest way to install everything is to use pip:\n\n $ pip install jingerly\n\nThis installs the `jingerly` command line script as well as the Python module (should you want it).\n\nIf you don't want to install everything globally then you can use a virtualenv, I like to keep mine in `/usr/local`:\n\n $ cd /usr/local\n $ virtualenv jingerly\n $ . jingerly/bin/activate\n $ pip install jingerly\n $ ln -s ../jingerly/bin/jingerly bin/jingerly\n\nOr, if you wanted to grab the source code:\n\n $ git clone https://github.com/WilliamMayor/jingerly.git\n $ cd jingerly\n $ virtualenv venv\n $ . venv/bin/activate\n $ pip install -r requirements.txt\n\nFrom here you can run the tests using nose:\n\n $ nosetests\n\n## Examples\n\nThere's an example in the examples directory that demonstrates the features mentioned in this README.", "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/WilliamMayor/jingerly", "keywords": "project management template", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "jingerly", "package_url": "https://pypi.org/project/jingerly/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jingerly/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/WilliamMayor/jingerly" }, "release_url": "https://pypi.org/project/jingerly/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Project templating using Jinja2.", "version": "0.0.3" }, "last_serial": 1424223, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "044704dd5e6e84696b1520635ada1f79", "sha256": "34450c71e74e5fcb9595a4d2b42b09aaaffcfc1eb29eb2aa5bbf3ec54945ad8f" }, "downloads": -1, "filename": "jingerly-0.0.1.tar.gz", "has_sig": false, "md5_digest": "044704dd5e6e84696b1520635ada1f79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5204, "upload_time": "2015-02-14T23:13:13", "url": "https://files.pythonhosted.org/packages/dd/42/a7d767bbc535b311c2e7d4a784c0647139d96cb42509b0eb68e2400289c6/jingerly-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "bc85f344390f261a729ba57a463b5c20", "sha256": "32ac2937ca9f73e5c40da9d56bcfebbd49df0e45520167d60d5bca86de2a7744" }, "downloads": -1, "filename": "jingerly-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bc85f344390f261a729ba57a463b5c20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5390, "upload_time": "2015-02-15T17:16:23", "url": "https://files.pythonhosted.org/packages/31/09/e47e699cb883f1b2d932669e4f43a20edf0fb89eaaa0c4c3b60f4eb3fd7c/jingerly-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "ec87269ed700f600e7e8f7a194c2fbd2", "sha256": "572e2628267c14d48c394cc2cf98106c898f5772b7a04fdb20a68ff369d963e9" }, "downloads": -1, "filename": "jingerly-0.0.3.tar.gz", "has_sig": false, "md5_digest": "ec87269ed700f600e7e8f7a194c2fbd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5874, "upload_time": "2015-02-15T17:21:34", "url": "https://files.pythonhosted.org/packages/e8/2c/329388e96571fe79f52c7e06797fe7525b5eeb1e02aa6704d0d985c38b6d/jingerly-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ec87269ed700f600e7e8f7a194c2fbd2", "sha256": "572e2628267c14d48c394cc2cf98106c898f5772b7a04fdb20a68ff369d963e9" }, "downloads": -1, "filename": "jingerly-0.0.3.tar.gz", "has_sig": false, "md5_digest": "ec87269ed700f600e7e8f7a194c2fbd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5874, "upload_time": "2015-02-15T17:21:34", "url": "https://files.pythonhosted.org/packages/e8/2c/329388e96571fe79f52c7e06797fe7525b5eeb1e02aa6704d0d985c38b6d/jingerly-0.0.3.tar.gz" } ] }