{ "info": { "author": "Miguel \u00c1ngel Garc\u00eda", "author_email": "miguelangel.garcia@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent" ], "description": "============== =============== ========= ============\nVERSION DOWNLOADS TESTS COVERAGE\n============== =============== ========= ============\n|pip version| |pip downloads| |travis| |coveralls|\n============== =============== ========= ============\n\n**STILL UNDER HEAVY DEVELOPMENT**\n\nCheckout the repository_.\n\nGoal and Philosophy\n===================\n\nManages templates to allow projects inception.\n\nI'm tired of doing repetitive steps whenever I create a new project: configure Travis, add the ``.gitignore``, create a new ``setup.py``, etc. So I decided to automate it. And I want anybody can contribute with templates **without any Python knowledge**.\n\nThis project is in its first stages, so do not be too tidy.\n\n\nHow to use it\n=============\n\nInstallation\n------------\n\nFrom pypi:\n\n.. code::\n\n pip install inception\n\nFrom the main repository:\n\n.. code::\n\n git clone https://github.com/magmax/inception.git\n\n\nUsage\n-----\n\nAs easy as:\n\n.. code::\n\n python inception/__main__.py --template-path TEMPLATE -o OUTPUT_PATH\n\n\nTemplate creation\n=================\n\nThe idea is to maintain easy but powerful templates. Learning Python is not required, but useful.\n\nTo create a new template, there is just one requirement: the settings.py file.\n\n\nsettings.py file\n----------------\n\nThis file contains the settings to rule the inception. It will contains some variables (just Python_ vars).\n\nThe main one is ``program``, that is a vector. here you have an example:\n\n.. code::\n\n # as vector\n program = [\n inquire(),\n copy(),\n ]\n\n\n\nAny operation inside the ``program`` vector is a \"promise\". This means it won't be evaluated until it is called later.\n\nThere are several preloaded promises, but you can write your own. We will come back to this later.\n\n``inquire`` promise\n~~~~~~~~~~~~~~~~~~~\n\nRequires information from the user.\n\nAs parameter, you can pass an array of Questions, as it is defined in inquirer_. If no argument is supplied, it will try to get the ``QUESTIONS`` variable from the settings file.\n\nNext examples are equivalent:\n\n.. code::\n\n QUESTIONS = [\n { \"kind\": \"text\",\n \"name\": \"name\",\n \"message\": \"What's your name\"\n },\n ]\n\n program = [\n inquire(),\n ]\n\n.. code::\n\n QUESTIONS = [\n { \"kind\": \"text\",\n \"name\": \"name\",\n \"message\": \"What's your name\"\n },\n ]\n\n program = [\n inquire(QUESTIONS),\n ]\n\n.. code::\n\n program = [\n inquire([\n { \"kind\": \"text\",\n \"name\": \"name\",\n \"message\": \"What's your name\"\n },\n ]),\n ]\n\n``copy`` promise\n~~~~~~~~~~~~~~~~\n\nThis promise will copy some directory structure from our templates to the output directory. The directory structure will be copied **as is**, this means you will have to repeat the whole tree you want to build.\n\nIt allows an argument, that is the directory to be used as source. If no argument is supplied, ``files`` will be used.\n\nIf any file ends with ``.jinja``, it will be managed as a jinja_ template, replacing any variable inside with any variable taken with the ``inquire`` promise.\n\nThis structure is valid for file names too.\n\nStructures examples:\n\n.. code::\n\n .\n \u251c\u2500\u2500 files\n \u2502 \u2514\u2500\u2500 level_1\n \u2502 \u2514\u2500\u2500 level_2\n \u2502 \u251c\u2500\u2500 example1.txt\n \u2502 \u251c\u2500\u2500 example2.txt.jinja\n \u2502 \u2514\u2500\u2500 {{ name }}.txt\n \u2514\u2500\u2500 settings.py\n\nwith ``name=\"example3\"`` will produce:\n\n.. code::\n\n output\n \u2514\u2500\u2500 level_1\n \u2514\u2500\u2500 level_2\n \u251c\u2500\u2500 example1.txt\n \u251c\u2500\u2500 example2.txt\n \u2514\u2500\u2500 example3.txt\n\nExisting files won't be overriden.\n\n\n``run`` promise\n~~~~~~~~~~~~~~~\n\nExecutes any command line script. The script should be provided as first argument. Example:\n\n.. code::\n\n program = [\n run('virtualenv venv'),\n ]\n\nPipes are not allowed.\n\n\nCreating your own promises\n--------------------------\n\nPython knowledge is required to do this.\n\nThey can be defined inside the ``settings.py`` module or to be imported from other modules in the ``settings.py``\n\nA promise is just a function returning another function. Inner function should match the pattern:\n\n.. code:: python\n\n def inner(config, template_path, output):\n pass\n\nThere are two ways to do this: with functions or classes.\n\nFunction promises\n~~~~~~~~~~~~~~~~~\n\nAn example is better than a thausand words:\n\n.. code:: python\n\n def my_promise(argument_1, argument_2):\n def inner(config, template_path, output):\n # do whatever with argument_1, argument_2, and the others\n pass\n return inner\n\nClass promises\n~~~~~~~~~~~~~~\n\nSame example:\n\n.. code:: python\n\n class my_promise(object):\n def __init__(self, argument_1, argument_2):\n self._arg1 = argument_1\n self._arg2 = argument_2\n\n def __call__(self, config, template_path, output):\n # do whatever with argument_1, argument_2, and the others\n pass\n\nPromises usage\n~~~~~~~~~~~~~~\n\nBoth class and function promises are used in the same way:\n\n.. code:: python\n\n program = [\n my_promise('argument_1', 'argument_2')\n ]\n\n\n\nTo do list\n==========\n\nThings I'd like to add to inception:\n\n- a Downloader class, that retrieves the package from github.\n- a file with the list of available templates, to use its name instead its directory. This will allow to improve the Downloader class.\n- better output\n- tests.\n- debianize it.\n\n\nLicense\n=======\n\nCopyright (c) 2014 Miguel \u00c1ngel Garc\u00eda (`@magmax9`_).\n\nLicensed under `the MIT license`_.\n\n\n.. |travis| image:: https://travis-ci.org/magmax/inception.png\n :target: `Travis`_\n :alt: Travis results\n\n.. |coveralls| image:: https://coveralls.io/repos/magmax/inception/badge.png\n :target: `Coveralls`_\n :alt: Coveralls results_\n\n.. |pip version| image:: https://pypip.in/v/inception/badge.png\n :target: https://pypi.python.org/pypi/inception\n :alt: Latest PyPI version\n\n.. |pip downloads| image:: https://pypip.in/d/inception/badge.png\n :target: https://pypi.python.org/pypi/inception\n :alt: Number of PyPI downloads\n\n.. _Travis: https://travis-ci.org/magmax/inception\n.. _Coveralls: https://coveralls.io/r/magmax/inception\n\n.. _@magmax9: https://twitter.com/magmax9\n\n.. _the MIT license: http://opensource.org/licenses/MIT\n.. _download the lastest zip: https://pypi.python.org/pypi/inception\n.. _inquirer: https://travis-ci.org/magmax/python-inquirer\n.. _repository: https://travis-ci.org/magmax/inception\n.. _jinja: http://jinja.pocoo.org/", "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/magmax/inception", "keywords": "templates,project creation,inception,project inception,start", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "inception", "package_url": "https://pypi.org/project/inception/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/inception/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/magmax/inception" }, "release_url": "https://pypi.org/project/inception/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Manages templates to allow projects inception.", "version": "0.0.3" }, "last_serial": 1362201, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a4159359a0587f9538207d7dc21ab800", "sha256": "366e031af526ec03dc5960f9dc4d25bb11dbc9649d5a3592d30bd096d1cbf807" }, "downloads": -1, "filename": "inception-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "a4159359a0587f9538207d7dc21ab800", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7927, "upload_time": "2014-12-25T18:05:29", "url": "https://files.pythonhosted.org/packages/30/ee/4a83eadbef5ea3ee53514db28a1754b4c8a2da4073646c3083872e1dd439/inception-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "83f1f69176c1df1a6ca4ff374f864d9c", "sha256": "c59b383f1c23716b24b33ce4d79182aa2e73d2753d41dffc8c081fb7df543b61" }, "downloads": -1, "filename": "inception-0.0.1.tar.gz", "has_sig": false, "md5_digest": "83f1f69176c1df1a6ca4ff374f864d9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4804, "upload_time": "2014-12-25T18:05:26", "url": "https://files.pythonhosted.org/packages/8f/bd/92536c8508ccfeaa47851b1df59a1c36f099adb222df54f75bb95f407f48/inception-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "c93105f8cad6c23ecf6e0ac9e122ef6b", "sha256": "d3c5944e507537a48bb4fe912417b51b257d0b3802229a5849619902829c6990" }, "downloads": -1, "filename": "inception-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "c93105f8cad6c23ecf6e0ac9e122ef6b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8524, "upload_time": "2014-12-26T08:25:55", "url": "https://files.pythonhosted.org/packages/22/8e/540b01cfba901a4c87fe828368461fb31baeae518e0498e645728dbd4671/inception-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35728c974d1dbba493fddff98b402b75", "sha256": "37e32abecb2c1ceb812bc72f023d7fadd7041c9be3d8d96a9a893174777d3efb" }, "downloads": -1, "filename": "inception-0.0.2.tar.gz", "has_sig": false, "md5_digest": "35728c974d1dbba493fddff98b402b75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5196, "upload_time": "2014-12-26T08:26:09", "url": "https://files.pythonhosted.org/packages/cc/a3/dd0ee5f532f2c7327a60c056b8d83eb1bf60bdbb748be41fcc6b61017c46/inception-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "ec89e846d4054bdb85864e3af6eda42b", "sha256": "27bd44ce3761cc4f3bf3b167065ee518d2138588a2bc0b5ed488e8f815669f46" }, "downloads": -1, "filename": "inception-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "ec89e846d4054bdb85864e3af6eda42b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10234, "upload_time": "2014-12-27T17:53:40", "url": "https://files.pythonhosted.org/packages/a1/33/6719d46c9bb97a1cd7b5e56b6a610ed4d494d5ffca0c2a8e3890aa63dfa6/inception-0.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6c3ed3099819415a58d3fcd29ce43ca", "sha256": "b9b35261ad7cb747c5dd65fd65294eb24736b141b36b950a798903cd682cf1c4" }, "downloads": -1, "filename": "inception-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d6c3ed3099819415a58d3fcd29ce43ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6785, "upload_time": "2014-12-27T17:53:37", "url": "https://files.pythonhosted.org/packages/4f/4c/b5222986906ff7ba39b52b277a342eb75bf3a87c6db486236dcf7e3fdaec/inception-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ec89e846d4054bdb85864e3af6eda42b", "sha256": "27bd44ce3761cc4f3bf3b167065ee518d2138588a2bc0b5ed488e8f815669f46" }, "downloads": -1, "filename": "inception-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "ec89e846d4054bdb85864e3af6eda42b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10234, "upload_time": "2014-12-27T17:53:40", "url": "https://files.pythonhosted.org/packages/a1/33/6719d46c9bb97a1cd7b5e56b6a610ed4d494d5ffca0c2a8e3890aa63dfa6/inception-0.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6c3ed3099819415a58d3fcd29ce43ca", "sha256": "b9b35261ad7cb747c5dd65fd65294eb24736b141b36b950a798903cd682cf1c4" }, "downloads": -1, "filename": "inception-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d6c3ed3099819415a58d3fcd29ce43ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6785, "upload_time": "2014-12-27T17:53:37", "url": "https://files.pythonhosted.org/packages/4f/4c/b5222986906ff7ba39b52b277a342eb75bf3a87c6db486236dcf7e3fdaec/inception-0.0.3.tar.gz" } ] }