{ "info": { "author": "Anthony Grimes", "author_email": "i@raynes.me", "bugtrack_url": null, "classifiers": [], "description": "# basement\n\nBasement is an extensible little tool for generating Python project scaffolding\nbased on mustache templates and common data you provide in a config file. It's\nsuper straightforward.\n\n## Installation\n\n```\npip install basement\n```\n\nNot much more to say!\n\n## Some Assembly Required (Usage)\n\nBasement ships with two commands, `basement` and `ment`. `ment` is a shorthand\nfor `basement` and thus is exactly the same.\n\nSome assembly is required, and you'll have to break out a screwdriver. Basement\nis mostly useful because you can customize it! You can add your own templates\n(which we will go over in the next section) as well as configure filler data for\nall templates. We'll go over data the built in templates can make use of, as\nwell as what the built in templates are.\n\n### Built In Templates\n\nBasement comes with three built in templates:\n\n* `default`: the default template (as you may have guessed) that is used when\n you don't specify a different one.\n* `app`: a template defining a skeleton project using `click` to make a simple\n program with a command line interface.\n* `flask`: a template defining a skeleton Flask website.\n \n \n\nYou specify which template to use with the `-t` flag.\n\n```\nment foo -t app\n```\n\nThe above example would use the `app` template to generate the `foo` project.\n\n### DATA\n\nTemplates aren't terribly useful until you fill them up with filler\ndata. Basement uses a [toml](https://github.com/toml-lang/toml) configuration\nfile to define this data. Create a file called `~/.basement` containing\nsomething like the following:\n\n```toml\nfull-name = \"Anthony Grimes\"\nemail = \"anemail@raynes.me\"\ngithub-user = \"Raynes\"\nlicense = \"MIT\"\n```\n\nLet's take a look at a file in the default template. This is `setup.py`:\n\n```python\n\"\"\"Your project's description\"\"\"\nfrom setuptools import setup\n\nwith open('requirements.txt') as f:\n requirements = f.readlines()\n\nsetup(\n name='{{project-name}}',\n description=\"A project that does things!\",\n version='0.1.0',\n long_description=__doc__,\n packages=['{{project-name}}'],\n author='{{full-name}}',\n author_email='{{email}}',\n url='https://github.com/{{github-user}}/{{project-name}}',\n license='{{license}}',\n install_requires=requirements\n)\n```\n\nNotice all the `{{}}` things (mustaches)? These are mustache artifacts. When you\ncreate a project based on this template, those will be mapped to keys in your\nconfiguration file and filled in with the data present there. If I render based\non my config file, I get this:\n\n```\nAnthony@lastlight:~/code/basement (master *)\n$ ment foobar\nRendered template 'default' at /Users/Anthony/code/basement/foobar\nAnthony@lastlight:~/code/basement (master *)\n$ cat foobar/setup.py\n\"\"\"Your project's description\"\"\"\nfrom setuptools import setup\n\nwith open('requirements.txt') as f:\n requirements = f.readlines()\n\nsetup(\n name='foobar',\n description=\"A project that does things!\",\n version='0.1.0',\n long_description=__doc__,\n packages=['foobar'],\n author='Anthony Grimes',\n author_email='anemail@raynes.me',\n url='https://github.com/Raynes/foobar',\n license='MIT',\n install_requires=requirements\n)\n```\n\n#### Ignoring Files\n\nSometimes you don't want to touch certain files, in particular binary\nfiles. `pystache`, the library basement uses to render mustache templates, often\ndoes not like being fed binary files and you most certainly don't want huge\nfiles to be read into memory to be rendered! For these situations, basement\nprovides a flexible mechanism for ignoring files. It works like so:\n\n```\npass = ['path/to/be/ignored/.*']\n```\n\n`pass` can appear in your configuration and as each file is rendered, it is\nchecked against the regular expressions using Python's `re.search` function. If\nany of the patterns match that file path, it is ignored and simply passed\nthrough.\n\nNote that you can also use the special file extension `.basement-ignore` as\nwell, as demonstrated in the next section.\n\n## Creating Templates\n\nBasement is designed so you can create your own templates really easily. All you\nhave to do is create a directory in `~/.basement-templates` where all templates\nare stored and simply fill it with whatever files and content that you want,\nadding mustaches wherever you want to fill in data from your config.\n\nOne thing to note is that `project-name` is filled in with the basename of the\noutput path you give basement. So if you run `ment path/to/project`, your\n`project-name` will be `project`.\n\n### Special Files\n\nWhile writing your template (particularly if you wanted to write one to be\nincluded with basement), you'd likely notice that upon compilation setuptools\ntries to generate pyc files from your template py files and that'll likely cause\nerrors (mustache isn't valid Python syntax for some reason ;)). The way around\nthat is to add a special extension:\n\n```\nfoo.py.basement-template\n```\n\nThis will keep Python from compiling the file and basement will rename it when\ngenerating a project\n\nAnother important special extension is `.basement-ignore`, which tells basement\nto not try to render the contents of the file (though if mustaches appear in the\nfile name itself, those will be rendered). This is useful when you have files\nthat contain `{{}}` mustaches but you don't want them to be rendered. For\nexample, jinja templates.\n\n### Template-Specific Configuration\n\nYou can add configuration specifically for certain templates and any keys\npresent there that are also present at the top level override the top-level\nkeys. You simply use toml sections like so:\n\n```toml\nfull-name = \"Anthony Grimes\"\nemail = \"anemail@raynes.me\"\ngithub-user = \"Raynes\"\nlicense = \"MIT\"\n\n[app]\nlicense = \"EPL\"\n```\n\nGiven this configuration, when you create a project based on the `app` template,\n`license` mustaches will be set to `EPL` rather than `MIT`. You can add\nconfiguration specific to your own templates by doing the same thing, simply\nadding sections with the name of the templates.\n\n## Updating Basement\n\nWhen you decide to update your basement (perhaps you want to add a pool table),\nthere are some updating mechanisms in place. When you run basement, it _always_\nwipes its templates and re-adds them. This means that you *cannot* make changes\nto the built in templates. If you want to make changes, you should make a new\ntemplate.", "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/Raynes/basement", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "basement", "package_url": "https://pypi.org/project/basement/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/basement/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Raynes/basement" }, "release_url": "https://pypi.org/project/basement/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "A python project scaffolding generator.", "version": "0.2.2" }, "last_serial": 1334590, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5acb1ed9fb3123f70e714c8783dbe66e", "sha256": "8e4cd17d3c4cee65c269f4f8c5d7c73569bea5b836553ff8e6f4368fe7c7b720" }, "downloads": -1, "filename": "basement-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5acb1ed9fb3123f70e714c8783dbe66e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6506, "upload_time": "2014-06-24T03:03:46", "url": "https://files.pythonhosted.org/packages/b8/fb/d1203b4f9cb7ddd2b50f64f4efd572ba1a5655ed79e40dbff5c7f15f9f90/basement-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "42aa404878b676d40dbe08081b1ed537", "sha256": "c089e057ec930bc0ba13854206ace559b5ce29b980ebfd4ade8676f1bf24d547" }, "downloads": -1, "filename": "basement-0.1.1.tar.gz", "has_sig": false, "md5_digest": "42aa404878b676d40dbe08081b1ed537", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6834, "upload_time": "2014-06-24T03:04:37", "url": "https://files.pythonhosted.org/packages/0d/70/6e56a10558543fed2cd393da2abb4f7f280f054c51980365017d79a5d464/basement-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "853d2dbfcb66788f20db44756b8bc0de", "sha256": "50fce4c05cc542d3fd3670b76b5566a90492a9a2400d74088ecda69c6096d5be" }, "downloads": -1, "filename": "basement-0.1.2.tar.gz", "has_sig": false, "md5_digest": "853d2dbfcb66788f20db44756b8bc0de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7016, "upload_time": "2014-06-24T17:42:59", "url": "https://files.pythonhosted.org/packages/53/e0/68b3b7f4ddc845a0dec0fc6f4276ecf65740ef73ff745bdaf3f2c591649f/basement-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "51a18fdfcad516c93b1c3e71dfab8d09", "sha256": "bbf5681162dd7d2ee5e294297bcbbbb01836d7261c8a1e8d245f2567f99376ae" }, "downloads": -1, "filename": "basement-0.1.3.tar.gz", "has_sig": false, "md5_digest": "51a18fdfcad516c93b1c3e71dfab8d09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7035, "upload_time": "2014-06-24T17:45:30", "url": "https://files.pythonhosted.org/packages/d5/49/f562d29985fdda77a407b8cb356c928ae41b0b5a90deeb6160707fce6a4c/basement-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "0d59504b485c3ec449a9a408b584f398", "sha256": "875bcde867f6e964adc2b90251ba05ad753c54a3c0b6c06b1c28bd9e44281ea9" }, "downloads": -1, "filename": "basement-0.1.4.tar.gz", "has_sig": false, "md5_digest": "0d59504b485c3ec449a9a408b584f398", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7014, "upload_time": "2014-06-25T00:05:47", "url": "https://files.pythonhosted.org/packages/d9/51/0ba5d6a3b52fc5a35b404fbe05644031bf037d12e6c52252fdb38ae66e68/basement-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "b8eb2260c07792d0468b5125e4a80872", "sha256": "a47e91ac48c7bc1ac163960994d56efb5ec1439adaf3a2b631730a80265ff73c" }, "downloads": -1, "filename": "basement-0.1.5.tar.gz", "has_sig": false, "md5_digest": "b8eb2260c07792d0468b5125e4a80872", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6936, "upload_time": "2014-06-25T16:52:48", "url": "https://files.pythonhosted.org/packages/de/4a/e4ff84f85ea0a292c6d28b382a0aed0043d97596ebe444e7278d0166a29c/basement-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "09595c8d1f381ac9ed1f469594cfb5bf", "sha256": "cbc02daf3c576ffbe23de8e194a0aea5fcf393612bce75c9dd40e61eb5b74497" }, "downloads": -1, "filename": "basement-0.1.6.tar.gz", "has_sig": false, "md5_digest": "09595c8d1f381ac9ed1f469594cfb5bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6907, "upload_time": "2014-06-25T17:32:02", "url": "https://files.pythonhosted.org/packages/79/3a/12d28882a26da5a20254eb88784c3bc226bfc09aa90e7b52c379c74cdcea/basement-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "f6540deed7f8fcd632ffa3896757b991", "sha256": "75164e264d61dd97b11268cf294c44b664f4d5dbd14ebe7b8afbc05dacf73e6e" }, "downloads": -1, "filename": "basement-0.1.7.tar.gz", "has_sig": false, "md5_digest": "f6540deed7f8fcd632ffa3896757b991", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6946, "upload_time": "2014-06-25T17:35:06", "url": "https://files.pythonhosted.org/packages/6b/38/f421841b8edda662c3aae8be581cba04d885ad9a1e15d12354317c7cfebc/basement-0.1.7.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7bfa72b319c969de7da57224b3dc7184", "sha256": "ae3eab57f6dedc6b5f0db1ffe164a84155f857794bb9e01f9615952f002759d1" }, "downloads": -1, "filename": "basement-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7bfa72b319c969de7da57224b3dc7184", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8840, "upload_time": "2014-06-26T21:01:45", "url": "https://files.pythonhosted.org/packages/4c/08/375a0602311dda481646c3d8c8a8f93c85d58c4b9dbcc5990ca252fc4583/basement-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "531bf1382ec7abfa5bded1a737af12f4", "sha256": "b7ec51d9fa91c97e445d1d17dc826db62c2240912e5f216100b67342e475f899" }, "downloads": -1, "filename": "basement-0.2.1.tar.gz", "has_sig": false, "md5_digest": "531bf1382ec7abfa5bded1a737af12f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8876, "upload_time": "2014-07-08T21:45:08", "url": "https://files.pythonhosted.org/packages/63/c3/056e42478bdfe66d910be0983711efc19af0f9752684528ecef38198fba3/basement-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "9d0a35a372e38fa5e372a5676fdc7a57", "sha256": "e8a93a8c70a78a330c459ddf9214970afc506543b247aa6ca5268030e09b9ce9" }, "downloads": -1, "filename": "basement-0.2.2.tar.gz", "has_sig": false, "md5_digest": "9d0a35a372e38fa5e372a5676fdc7a57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9238, "upload_time": "2014-12-07T23:08:25", "url": "https://files.pythonhosted.org/packages/77/6c/0a5636b8f2ad69be577cc26eddccac19706c37e0f5d53ab31d3836055335/basement-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9d0a35a372e38fa5e372a5676fdc7a57", "sha256": "e8a93a8c70a78a330c459ddf9214970afc506543b247aa6ca5268030e09b9ce9" }, "downloads": -1, "filename": "basement-0.2.2.tar.gz", "has_sig": false, "md5_digest": "9d0a35a372e38fa5e372a5676fdc7a57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9238, "upload_time": "2014-12-07T23:08:25", "url": "https://files.pythonhosted.org/packages/77/6c/0a5636b8f2ad69be577cc26eddccac19706c37e0f5d53ab31d3836055335/basement-0.2.2.tar.gz" } ] }