{ "info": { "author": "D. Ben Knoble", "author_email": "ben.knoble@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Code Generators" ], "description": "# tmplr\n\n[![This project is considered stable](https://img.shields.io/badge/status-stable-success.svg)](https://benknoble.github.io/status/stable/)\n\nGenerate project files from templates on the command-line\n\n## Installation\n\n`tmplr` is on pip, so just\n\n```bash\n# python3 -m pip install tmplr\n```\n\n`tmplr` requires python 3 or greater.\n\n## Usage\n\nIf you find yourself creating lots of similar scripts or files, and you usually\njust do something like\n\n```bash\n# cp old new\n# $EDITOR new\n```\n\nthen `tmplr` is the solution.\n\nCreate temples (templates), then generate a file and start editing with\n\n```bash\n# tmplr sample-script var=value func_name=my_func -f script\n```\n\nSee your templates, or edit them, using the `temples` command:\n\n```bash\n# temples\nsample-script\nvim-ftplugin\n# temples -t sample-script\nsample-script : sample sh script\nPlaceholders\n\tvar\n\tfunc_name\n# temples -e -t sample-script\n```\n\n(This is based on the example given at the end of the format description.)\n\nSee below for the temple file format.\n\nBy default, temples live in `~/.tmplr`, but this is configurable with the `-d`\nswitch to both programs.\n\nSupply `-h` for more options.\n\n# Temple-file format\n\nA Temple file consists of two parts:\n1. header\n2. content\n\nThe header provides metadata specific to tmplr, and will be omitted when the\ntemplate is rendered into output.\n\nThe content is text, containing special template sequences which will be\nsubstituted by render arguments upon output.\n\nFile extensions are ignored.\n\n## Header format\n\nThe first line of the header must consist of the same character repeated\nthrice. We call this the \"comment character\" because, if you use a character\nconsidered a comment for the normal file content, editors will not choke on\nTemple headers.\n\nThe next lines consist of metadata and all follow this format:\n\n {comment character} key : value\n\nA value ends once the line is terminated by a newline character.\n\nAfter the metadata is the last line of the header--it is a carbon copy of the\nfirst line of the header.\n\nAnything after the second sequence of 3 comment characters is considered\ncontent and read literally.\n\n## Temple metadata\n\nThe supported key-value pairs are:\n- output\n The output directive can be a path (with `~` expansions), optionally\n containing the sequence `{fname}`. If the rendered template is written,\n it will be written to this path, with `{fname}` substituted for a\n filename by the engine (see `tmplr.temple.Temple.write`).\n\n If output is instead the string 'stdout', the rendered template will be\n printed to standard out.\n- help\n The help directive provides a short description of the template\n- delim\n The delim directive decides the special sequences that require render\n arguments.\n\n Any text of delim followed by name, or delim{name}, will be replaced by\n the render argument name (see `tmplr.temple.Temple.render`).\n\n Take care to choose a delim value that will not appear in the template\n except for in these escape sequences.\n\nUnsupported values will be ignored, but not cause a parsing error.\n\n### Example\n\n```bash\n###\n# output : /tmp/tmplr-test-example-{fname}\n# help : sample sh script\n# delim : %%\n###\n#! /bin/sh\n\nvar=%%var\n%%{func_name} () {\n echo do something\n}\n\necho ${%%var}\n```\n\n### End Example\n\nIn this example, the comment character is '#' because the file is a shell\nscript. `%%var` will be replaced in both places (since `%%` is the delim) by the\n`var` argument to render. Similarly `%%{func_name}` will be replaced the\n`func_name` argument to render.\n\nIf `fname` is passed as, e.g., `templar`, the result will be written to\n`/tmp/tmplr-test-example-templar`.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/benknoble/tmplr", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tmplr", "package_url": "https://pypi.org/project/tmplr/", "platform": "", "project_url": "https://pypi.org/project/tmplr/", "project_urls": { "Homepage": "https://github.com/benknoble/tmplr" }, "release_url": "https://pypi.org/project/tmplr/0.3.0/", "requires_dist": null, "requires_python": ">=3", "summary": "The holiest cli template system", "version": "0.3.0" }, "last_serial": 5616246, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b64c6e61ac09db9838200655d2edcb1b", "sha256": "7b79a6d61cfc87b82d07be39cd1b94aed8437b660f222fc100118350daa7ad1f" }, "downloads": -1, "filename": "tmplr-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b64c6e61ac09db9838200655d2edcb1b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8185, "upload_time": "2019-06-13T16:51:44", "url": "https://files.pythonhosted.org/packages/45/c6/ee397fc0b6cbe5aeec9894a997efb4b4533ffd3f821bfe28de6c5b4578a2/tmplr-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bfe61c506b7c430a5fa5481f44e441dc", "sha256": "a2ef6ee6ea24ad6337e32b2b611601a5d809058268beec01e53a4bea9de9e6f9" }, "downloads": -1, "filename": "tmplr-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bfe61c506b7c430a5fa5481f44e441dc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6402, "upload_time": "2019-06-13T16:51:47", "url": "https://files.pythonhosted.org/packages/02/9b/93fbd5709876c6512fb4cb052c861c328dcf50f56babf807d60edc309d8d/tmplr-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4b7813efd3a83016aa2b9359a1c22880", "sha256": "14dfa3d234d3432b20271975a4318f743a43b5897374e16d6048fa164fd00a62" }, "downloads": -1, "filename": "tmplr-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4b7813efd3a83016aa2b9359a1c22880", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 9636, "upload_time": "2019-06-13T17:09:21", "url": "https://files.pythonhosted.org/packages/57/63/3425735313a6d8d8c5be1faafbacd433400f4a068910ef4831de2961e3c0/tmplr-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6928365f2e8b59b481123a6bb119e36", "sha256": "44ba13fd01d980c1b426228748dea8c0f347b3e63ed96f70e3a0644cae44322b" }, "downloads": -1, "filename": "tmplr-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b6928365f2e8b59b481123a6bb119e36", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7482, "upload_time": "2019-06-13T17:09:23", "url": "https://files.pythonhosted.org/packages/58/17/a56dcf01326508268ef49cde01846460acfaa252c2ae53c3e9a0b9855924/tmplr-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "1c7d6561145d57ef3a68a94034a10fd0", "sha256": "2b991e7fd8fd91d55b3ca82cab3a23413a1dfaee499f4f1d4413ccdd20259342" }, "downloads": -1, "filename": "tmplr-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1c7d6561145d57ef3a68a94034a10fd0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 9709, "upload_time": "2019-07-05T21:30:59", "url": "https://files.pythonhosted.org/packages/16/9c/ac57d72439ea9c692c6507921a6948afd300644cd08e387fd90c6aa222c0/tmplr-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2fe175ad51532794a43011d42906c362", "sha256": "2b2f7e21d9996d442d82264f228eaa8eff5451efb8108015fe777e8db60eeaff" }, "downloads": -1, "filename": "tmplr-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2fe175ad51532794a43011d42906c362", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7572, "upload_time": "2019-07-05T21:31:02", "url": "https://files.pythonhosted.org/packages/13/77/6c134b1c55107dabdc8d676b4857310cda373766adee4121819a9a3686a6/tmplr-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "dc523ff1d5bb0ea7580117d5a6d1e261", "sha256": "542817e6c113608f1caeb6e6e88c24ad32f0499de54047de59f0ad682a48206a" }, "downloads": -1, "filename": "tmplr-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "dc523ff1d5bb0ea7580117d5a6d1e261", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 9748, "upload_time": "2019-07-10T01:17:18", "url": "https://files.pythonhosted.org/packages/43/39/7b587763bec1734e72cae2c7fd19a9a6ed236dbefc5f9cd1cf295fe750f7/tmplr-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ec7689e17b15d3f65495a07767aa2e09", "sha256": "ba7a93019e24a6c31bd7c9880826273955cc02a8bb801211df2cc2f9798ce26a" }, "downloads": -1, "filename": "tmplr-0.0.4.tar.gz", "has_sig": false, "md5_digest": "ec7689e17b15d3f65495a07767aa2e09", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7606, "upload_time": "2019-07-10T01:17:19", "url": "https://files.pythonhosted.org/packages/c2/e0/8c05aa9238987e3a7f0046213c6bf266cfd2955e5b30bba7b787bb175fa2/tmplr-0.0.4.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "e043ede74f89b280f058337c662de8de", "sha256": "8ea7652dbc79b083c648e98f2e29e124e4ae7ccf0268785f53f82b132edf25b8" }, "downloads": -1, "filename": "tmplr-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e043ede74f89b280f058337c662de8de", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 9885, "upload_time": "2019-07-10T01:32:16", "url": "https://files.pythonhosted.org/packages/f1/e2/7114a5f233e4097168919dd096db191694e697c1180c59e4235c8bd57041/tmplr-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e78acc425ae3f508ac797afa00eb892c", "sha256": "3e6734d2b781200c70746c750166cb95e7077df3d342a1f0ea0c1a23e04def96" }, "downloads": -1, "filename": "tmplr-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e78acc425ae3f508ac797afa00eb892c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7732, "upload_time": "2019-07-10T01:32:17", "url": "https://files.pythonhosted.org/packages/fa/78/f598c99ac600c30efe2aab8419a13f8daf8d772b65fe26f29e8e8c35b9e0/tmplr-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1cda9f1ff0764e0f0288fe19ee36088d", "sha256": "a64c91937a07d621a0354b397def2c9eede3f8185a9bf10cd368a1578c37d99a" }, "downloads": -1, "filename": "tmplr-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1cda9f1ff0764e0f0288fe19ee36088d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 9894, "upload_time": "2019-07-10T02:06:51", "url": "https://files.pythonhosted.org/packages/fe/35/eb31e051e9398973f10e1f707abd973c806bb5277afbdc2b9754e8d5687d/tmplr-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "52d07ec1e883bc6466ca1542d94991e5", "sha256": "ab08a13a3ac16f00669ca4d666798a7914c25249da217fa3b89e8c81c61a1921" }, "downloads": -1, "filename": "tmplr-0.1.1.tar.gz", "has_sig": false, "md5_digest": "52d07ec1e883bc6466ca1542d94991e5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7738, "upload_time": "2019-07-10T02:06:52", "url": "https://files.pythonhosted.org/packages/aa/8c/73e3ae892fe2afe00bfc908339ddaf993ed2b1339a594e14948478eff0e8/tmplr-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "eb41bfa11cf4b4242c2e3e2e6d40d813", "sha256": "0833705fbc8a3d6ec0938cc66df4752224062cbbcbf0874660ed6702c3ece999" }, "downloads": -1, "filename": "tmplr-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "eb41bfa11cf4b4242c2e3e2e6d40d813", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 10000, "upload_time": "2019-07-10T02:29:25", "url": "https://files.pythonhosted.org/packages/b8/e6/2abdcd39fd3a44ad789f428f5e084c04c4d59b7ba321b2f7b6364a7dd9b0/tmplr-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "726d81ec5970c88ac50f754f99f7c057", "sha256": "2577fe5b14855efea13c205bb1a99519a3005ce81f02779537f20fc19de24dbb" }, "downloads": -1, "filename": "tmplr-0.2.0.tar.gz", "has_sig": false, "md5_digest": "726d81ec5970c88ac50f754f99f7c057", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7815, "upload_time": "2019-07-10T02:29:26", "url": "https://files.pythonhosted.org/packages/63/d8/235a9a52ff1ebbcd5ad0b379e65676d1b0ef45c07cf40bc149a25bd7fd80/tmplr-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "08c8cc07d1dcebe1553d4978d923bc63", "sha256": "e62f9c05205c66a4046b9c51ae0e3f0c1731bf428c127eacd1387a876d07cf91" }, "downloads": -1, "filename": "tmplr-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "08c8cc07d1dcebe1553d4978d923bc63", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 10022, "upload_time": "2019-07-13T15:34:15", "url": "https://files.pythonhosted.org/packages/8e/34/5ab849c096b76cbfeab4a35e214448b5f5afea66aaf5d61bb4965d16bd28/tmplr-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "72ce14f3eaa868b15c1dd69b0a0630ce", "sha256": "9054c54c62e577291ad01fc83edde505968431200ae882281f8e6d9ab3699070" }, "downloads": -1, "filename": "tmplr-0.2.1.tar.gz", "has_sig": false, "md5_digest": "72ce14f3eaa868b15c1dd69b0a0630ce", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7848, "upload_time": "2019-07-13T15:34:17", "url": "https://files.pythonhosted.org/packages/8e/da/4b507f961d9ef05c98c55cff7dcd77916aaa068f36cc20c8ef7918b95dba/tmplr-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "7e8bdc1b899b4ccb94695232cd0b2df9", "sha256": "309101de446ff04b15848a91fcc1b86206c9c84f3bec64ba0c2b241e1f71c379" }, "downloads": -1, "filename": "tmplr-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7e8bdc1b899b4ccb94695232cd0b2df9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 10140, "upload_time": "2019-08-01T01:15:29", "url": "https://files.pythonhosted.org/packages/9d/bd/0219f9ec710daaafcbdadb19bfcbebb51bf3ca50167c6668f7e5a96d15ed/tmplr-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a125ed623b46c85d5728036bc476724c", "sha256": "2710ca2348e62dd0a1f3e8bc51fb33c57693c5da90de9096db9654eb37338a6a" }, "downloads": -1, "filename": "tmplr-0.3.0.tar.gz", "has_sig": false, "md5_digest": "a125ed623b46c85d5728036bc476724c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8024, "upload_time": "2019-08-01T01:15:30", "url": "https://files.pythonhosted.org/packages/27/1e/53c1a866afa3050a470ea9b11d7c7d138018f07b8dfcc9592c3dcdfb164b/tmplr-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7e8bdc1b899b4ccb94695232cd0b2df9", "sha256": "309101de446ff04b15848a91fcc1b86206c9c84f3bec64ba0c2b241e1f71c379" }, "downloads": -1, "filename": "tmplr-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7e8bdc1b899b4ccb94695232cd0b2df9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 10140, "upload_time": "2019-08-01T01:15:29", "url": "https://files.pythonhosted.org/packages/9d/bd/0219f9ec710daaafcbdadb19bfcbebb51bf3ca50167c6668f7e5a96d15ed/tmplr-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a125ed623b46c85d5728036bc476724c", "sha256": "2710ca2348e62dd0a1f3e8bc51fb33c57693c5da90de9096db9654eb37338a6a" }, "downloads": -1, "filename": "tmplr-0.3.0.tar.gz", "has_sig": false, "md5_digest": "a125ed623b46c85d5728036bc476724c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8024, "upload_time": "2019-08-01T01:15:30", "url": "https://files.pythonhosted.org/packages/27/1e/53c1a866afa3050a470ea9b11d7c7d138018f07b8dfcc9592c3dcdfb164b/tmplr-0.3.0.tar.gz" } ] }