{ "info": { "author": "Miguel Salgado", "author_email": "me@ekiim.xyz", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Text Processing" ], "description": "# Jinja Simple CLI\n\n\n\nThis project offers a way to easily compose templates directly from the \ncommand line, ideal to use in junction with other cli utilities.\n\nYou could check the examples under the `examples` directory and check the\t\nBy running `jinja-cli --help` on your terminal, you'll get all the basic functioning for the tool.\n\n\n## Basics\n\nIf you know [Jinja][jinja], you will get how this works easily.\n\n- `INPUT` or _template_, is the text stream or file that you are attempting to render _by default stdin_.\n- `DATA` or _json-data_, is the text stream or file that contains the data used in the template and it's dependencies, _by default is an empty json_.\n- `ROOT` or _template-directory_, is the search path for jinja's `FileSystemLoader`.\n- `CONFIG` or _extensions-file_, is a python file that contains functions that will be avalible to call from the templates, could be filters. \n- `OUTPUT` or `output`, is where to write the rendered template, _by default is stdout_.\n\n__Remark__: This is more related to `*sh` scripting than this tool, but notice that we mention streams, so we could run the following commands and they would be equivalent in output.\n\n```\ncat examples/templates/users.htm | jinja-cli -j examples/data/users.json\ncat examples/data/users.json | jinja-cli -j - -i examples/templates/users.htm\njinja-cli -i examples/templates/users.htm -j examples/data/users.json\njinja-cli -i <(cat examples/templates/users.htm) -j <(cat examples/data/users.json)\n```\n\nThis is because the argument parsing for the input template and json data, was thinked in a way that you send any of does two as streams so we could use and compose with other cli tools.\n\n\n## Examples\n\nAll the examples could be reproduced with the files in the `examples` directory.\n\n### Curl in to a template\n\nUsing the data variables you could fill templates pulling data from any kind of source, and insert it using standard input\n\n```\n$ curl https://xkcd.com/2/info.0.json 2> /dev/null | jinja-cli -i examples/templates/xkcd.htm -j -\n
\n

Petit Trees (sketch)

\n \n

'Petit' being a reference to Le Petit Prince, which I only thought about halfway through the sketch

\n
\n```\n\n### Using Jinja Filters\n\nYou could also use custom functions and call them as filters from your `config` file, eg.\n\n```python3\n\n# fragment of examples/extensions.py\nimport jinjasimplecli.extensions as je\n\n@je.filter('issue')\ndef hello_world(issue_number):\n url = f\"https://api.github.com/repos/ekiim/jinjasimplecli/issues/{issue_number}\"\n data = requests.get(url).json()\n return f\"Issue - {data['number']} - {data['title']}\"\n```\n\nSo now running `$ echo \"{{ 1|issue }}\" | jinja-cli -c examples/extensions.py` we get \n`Issue - 1 - Merge Guide and Readme`. \n\n### Jinja other features\n\nWhen using template inheritance or referencing another template to import or include, \nyou should make reference to it, considering the `ROOT` path you provided.\n\n\n## License\n\nJinja Simple CLI is licensed under the [BSD 3-Clause license][license].\n\n\n[jinja]: http://jinja.pocoo.org/docs/2.10/api/\n[license]: blob/master/LICENSE\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/ekiim/jinjasimplecli", "keywords": "jinja templates cli", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "jinjasimplecli", "package_url": "https://pypi.org/project/jinjasimplecli/", "platform": "", "project_url": "https://pypi.org/project/jinjasimplecli/", "project_urls": { "Homepage": "https://github.com/ekiim/jinjasimplecli" }, "release_url": "https://pypi.org/project/jinjasimplecli/1.0.7/", "requires_dist": [ "jinja2" ], "requires_python": "", "summary": "Jinja Simple CLI, is a tool that allows you to compose and insert data in to templates, with support for template inheritance and global functions. It uses json files as input for the data, and it can handle templates from standard input.", "version": "1.0.7" }, "last_serial": 5389072, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "af0bd322dbd4e1fcf9a541cd9123f8fe", "sha256": "5970e72ed7af9a01fda1695b8a88e3b965dabdce86846a849e67b39bb82a6de0" }, "downloads": -1, "filename": "jinjasimplecli-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "af0bd322dbd4e1fcf9a541cd9123f8fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6974, "upload_time": "2019-06-11T09:55:43", "url": "https://files.pythonhosted.org/packages/4b/37/7aeb0ab713da13fe0aa6ae2b410a41e2a260f23f2e9df2b46881bfc2e864/jinjasimplecli-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4dad0664562459447962838131556b12", "sha256": "7cd12007f100a578fe4300589099113db77a1270aae45274c190e631c7bdfc88" }, "downloads": -1, "filename": "jinjasimplecli-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4dad0664562459447962838131556b12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4999, "upload_time": "2019-06-11T09:55:46", "url": "https://files.pythonhosted.org/packages/03/eb/d8d7ac3b090dfb9b0ea22802b550f8e07b5164acb6a425ba25b13092d114/jinjasimplecli-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e257deab2b202aabb8444dd4953d5a8e", "sha256": "373e4e39431918417da08dc246336e6c0cb7417ab15c6e8518832314e0dca53d" }, "downloads": -1, "filename": "jinjasimplecli-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e257deab2b202aabb8444dd4953d5a8e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7032, "upload_time": "2019-06-12T01:46:31", "url": "https://files.pythonhosted.org/packages/d7/12/bf088a1290ed7a79367125338ac43941d9c1046c68e807c5aa66e41f4f5f/jinjasimplecli-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "da962b8004a5a928c6814582050a64dc", "sha256": "9db4debd4ab956909d3279123ad1ebe9aaabab2f3a2511d80f741403db0bf00d" }, "downloads": -1, "filename": "jinjasimplecli-1.0.1.tar.gz", "has_sig": false, "md5_digest": "da962b8004a5a928c6814582050a64dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5055, "upload_time": "2019-06-12T01:46:33", "url": "https://files.pythonhosted.org/packages/14/43/b25ff8715d4b9f101182ff14a199a9c8db4da2323df2098c00efcb3684d2/jinjasimplecli-1.0.1.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "b12a691203da9c9aa1890e76aa628536", "sha256": "c65322e91b812731241f535b96b61fec7397a1d876fae394c819eafe61672623" }, "downloads": -1, "filename": "jinjasimplecli-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "b12a691203da9c9aa1890e76aa628536", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7115, "upload_time": "2019-06-12T02:04:32", "url": "https://files.pythonhosted.org/packages/ee/65/13bc20ebeda8b3b2d3e5196d2d445cadbce7976bab55c059b1ceaca40054/jinjasimplecli-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f0974d2a3eb2debb2c5d40f2987a8af3", "sha256": "965d1749091e69e4449dd321b72c4854d9ec76a9eae8ed541b93b014552cb305" }, "downloads": -1, "filename": "jinjasimplecli-1.0.4.tar.gz", "has_sig": false, "md5_digest": "f0974d2a3eb2debb2c5d40f2987a8af3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5132, "upload_time": "2019-06-12T02:04:34", "url": "https://files.pythonhosted.org/packages/aa/68/495999a664e47915f679feef1361a3fc33fcf51c4037ccaf269292dd82a9/jinjasimplecli-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "3bab497791ae1c1ee44b7ebac556abcb", "sha256": "c2e4bae98bf57ac5f264cc61078196d6f172d912b02dd6ba229ffef0566f5450" }, "downloads": -1, "filename": "jinjasimplecli-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "3bab497791ae1c1ee44b7ebac556abcb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7137, "upload_time": "2019-06-12T02:08:43", "url": "https://files.pythonhosted.org/packages/3c/bc/1c25be8657427a86fe356f3d1355f4af8eadfe9ab4a437f4d9a66c0013f5/jinjasimplecli-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0b2368df9a5ec44bf8e69d0590de0689", "sha256": "0bbbc63102287e2370b18b6cdfd9ae819e343c98e5d1c71c39f45fc62d7e5d1f" }, "downloads": -1, "filename": "jinjasimplecli-1.0.5.tar.gz", "has_sig": false, "md5_digest": "0b2368df9a5ec44bf8e69d0590de0689", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5156, "upload_time": "2019-06-12T02:08:44", "url": "https://files.pythonhosted.org/packages/2d/f8/cdd582800db5fa86ab9442c3994c05eb9f704d10844a78c2ec861233572a/jinjasimplecli-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "ba9231b33b7ecfe9600fe52069086e49", "sha256": "3f3ef0ad1250ed91fb666f692c0ee8a2c0124c539d90afbaccad02fbd025be3c" }, "downloads": -1, "filename": "jinjasimplecli-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "ba9231b33b7ecfe9600fe52069086e49", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7133, "upload_time": "2019-06-12T02:12:18", "url": "https://files.pythonhosted.org/packages/ac/30/e50de1df90a2d96876306fce5e3562fd4f658d5b81c8abf9aab97d11421c/jinjasimplecli-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c312b6f4512aa44d287e3832aad0b2b0", "sha256": "3c19489ca10621a99aea2491b4aa86a5e77540a622a51400d7e42638296cfe7c" }, "downloads": -1, "filename": "jinjasimplecli-1.0.6.tar.gz", "has_sig": false, "md5_digest": "c312b6f4512aa44d287e3832aad0b2b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5153, "upload_time": "2019-06-12T02:12:19", "url": "https://files.pythonhosted.org/packages/62/ff/06d6979c85f1a1ed99c805d1ba499b3aca35a7c1ed9517eddb50b9cd3622/jinjasimplecli-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "8d0265d857d4cf597bd964d9e8e0bab3", "sha256": "3996713dbe2730e0e9cfe25640414e4aa2843b2fa3ed7a3a01e42f3129b625d3" }, "downloads": -1, "filename": "jinjasimplecli-1.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "8d0265d857d4cf597bd964d9e8e0bab3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7131, "upload_time": "2019-06-12T02:15:46", "url": "https://files.pythonhosted.org/packages/fa/d5/b099135913e8955204b7e53e7f0c357f46b66a86227a1d0e2ee416e2baee/jinjasimplecli-1.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aab87d667668f2b2224ec5ce1e47cdb0", "sha256": "17b637048fc9741a45842771907f025c5bc2c8b8aec88de3494be768d49d743b" }, "downloads": -1, "filename": "jinjasimplecli-1.0.7.tar.gz", "has_sig": false, "md5_digest": "aab87d667668f2b2224ec5ce1e47cdb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5150, "upload_time": "2019-06-12T02:15:47", "url": "https://files.pythonhosted.org/packages/b9/41/2e0b7825eadc10b9acda46d5770ce49e216ea36c277480622d6303905088/jinjasimplecli-1.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8d0265d857d4cf597bd964d9e8e0bab3", "sha256": "3996713dbe2730e0e9cfe25640414e4aa2843b2fa3ed7a3a01e42f3129b625d3" }, "downloads": -1, "filename": "jinjasimplecli-1.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "8d0265d857d4cf597bd964d9e8e0bab3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7131, "upload_time": "2019-06-12T02:15:46", "url": "https://files.pythonhosted.org/packages/fa/d5/b099135913e8955204b7e53e7f0c357f46b66a86227a1d0e2ee416e2baee/jinjasimplecli-1.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aab87d667668f2b2224ec5ce1e47cdb0", "sha256": "17b637048fc9741a45842771907f025c5bc2c8b8aec88de3494be768d49d743b" }, "downloads": -1, "filename": "jinjasimplecli-1.0.7.tar.gz", "has_sig": false, "md5_digest": "aab87d667668f2b2224ec5ce1e47cdb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5150, "upload_time": "2019-06-12T02:15:47", "url": "https://files.pythonhosted.org/packages/b9/41/2e0b7825eadc10b9acda46d5770ce49e216ea36c277480622d6303905088/jinjasimplecli-1.0.7.tar.gz" } ] }