{ "info": { "author": "Thomas Bechtold", "author_email": "tbechtold@suse.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5" ], "description": "j2gen\n=====\nTool to render `Jinja2`_ templates with mutliple input `YAML`_ data sources.\n\nFeatures\n--------\n- Render files as `Jinja2`_ templates (usually ending with .j2)\n- Use `YAML`_ as data source for templating\n- Multiple YAML data sources are allowed to overlay sources\n\nUsage\n-----\nLet's show some examples what `j2gen`_ is good for.\n\nSimple rendering\n++++++++++++++++\nA `test.j2` template::\n\n Hello {{ variable }} !\n\nA `test.yaml` file containing the data::\n\n ---\n variable: world\n\nWill render to::\n\n $ j2gen generate test.j2 test.yaml\n Hello world !\n\nBy default, `j2gen`_ will write its output to stdout. Use the `--output`\n(or `-o`) flag to write to a file::\n\n $ j2gen generate -o output test.j2 test.yaml\n $ cat output\n Hello world !\n\nRendering with multiple sources\n+++++++++++++++++++++++++++++++\nThere are cases where you want a common data source (eg. `common.yaml`)\nbut need to overwrite parts of the common source (eg. with `special.yaml`):\n\n`common.yaml` looks like::\n\n container:\n base: openSUSE-Leap-15.1\n name: memcached container for openSUSE\n description:\n short: memcached container\n long: memcached container for openSUSE\n\n`special.yaml` looks like::\n\n container:\n base: SLES15SP1\n name: memcached container for SLES15SP1\n description:\n long: memcached container for SUSE Linux Enterprise Server 15 SP1\n\n`template.j2` looks like::\n\n Base : {{ container.base }}\n Name : {{ container.name }}\n Desc short: {{ container.description.short }}\n Desc long : {{ container.description.long }}\n\nThis results in::\n\n $ j2gen generate template.j2 common.yaml special.yaml\n Base : SLES15SP1\n Name : memcached container for SLES15SP1\n Desc short: memcached container\n Desc long : memcached container for SUSE Linux Enterprise Server 15 SP1\n\nNote here that `container.description.short` is taken from the `common.yaml`\ninput while all the other variables are overwritten with the values from\n`special.yaml`. So dict/hash like structures in the YAML data sources are deep\nmerged.\nAnother important part is the order of the `input` files when calling\n`j2gen generate`. The last source wins (in this case `special.yaml`).\n\nContributing\n------------\nI'm happy about every contribution like bugfixes, filling issues, improving\ndocumentation or whatever.\n\n- For bugs: https://github.com/toabctl/j2gen/issues\n- For changes: https://github.com/toabctl/j2gen/pulls\n\nRunning tests\n+++++++++++++\n\nThe testsuite can be executed locally with::\n\n $ tox\n\n.. _Jinja2: https://jinja.palletsprojects.com/\n.. _YAML: https://yaml.org/\n.. _j2gen: https://github.com/toabctl/j2gen", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/toabctl/j2gen", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "j2gen", "package_url": "https://pypi.org/project/j2gen/", "platform": "", "project_url": "https://pypi.org/project/j2gen/", "project_urls": { "Homepage": "https://github.com/toabctl/j2gen" }, "release_url": "https://pypi.org/project/j2gen/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Jinja2 template renderer with yaml input files", "version": "0.1.0" }, "last_serial": 5905497, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c26d5b937358eadd73bc1196c8299926", "sha256": "94b307c77b77ed8d029754c70761e003a207ab7e9c3ff490ea5c37f408494b1e" }, "downloads": -1, "filename": "j2gen-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c26d5b937358eadd73bc1196c8299926", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8764, "upload_time": "2019-09-27T03:39:12", "url": "https://files.pythonhosted.org/packages/4d/3c/4801748662719fa2509d29a8f12f616479aa17db553c37caed457066a2e7/j2gen-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "f44b53ea6af326fad04cb318569761e7", "sha256": "3205ee960660b5d7140341014e7cf7c1552af54de81645e312e0c8605cc8965b" }, "downloads": -1, "filename": "j2gen-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f44b53ea6af326fad04cb318569761e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8931, "upload_time": "2019-09-30T08:26:11", "url": "https://files.pythonhosted.org/packages/8e/98/047d0679ab64bd767efd5e1decad8c1e6555cda67b89ec4d476d8feb1388/j2gen-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f44b53ea6af326fad04cb318569761e7", "sha256": "3205ee960660b5d7140341014e7cf7c1552af54de81645e312e0c8605cc8965b" }, "downloads": -1, "filename": "j2gen-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f44b53ea6af326fad04cb318569761e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8931, "upload_time": "2019-09-30T08:26:11", "url": "https://files.pythonhosted.org/packages/8e/98/047d0679ab64bd767efd5e1decad8c1e6555cda67b89ec4d476d8feb1388/j2gen-0.1.0.tar.gz" } ] }