{"id":19365151,"url":"https://github.com/m3t0r/tpl","last_synced_at":"2025-04-23T14:31:11.702Z","repository":{"id":48368798,"uuid":"139189101","full_name":"M3t0r/tpl","owner":"M3t0r","description":"Render templates with data from various sources","archived":false,"fork":false,"pushed_at":"2024-08-14T02:10:16.000Z","size":87,"stargazers_count":12,"open_issues_count":10,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T23:18:18.738Z","etag":null,"topics":["cli","jinja2","python","unix"],"latest_commit_sha":null,"homepage":"https://tpl.readthedocs.io/en/stable/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/M3t0r.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-29T19:42:58.000Z","updated_at":"2024-08-14T02:01:18.000Z","dependencies_parsed_at":"2024-11-10T07:39:27.795Z","dependency_job_id":"8f648ae1-a9f5-4bb7-9790-3ce6c06b3e7b","html_url":"https://github.com/M3t0r/tpl","commit_stats":{"total_commits":73,"total_committers":5,"mean_commits":14.6,"dds":"0.12328767123287676","last_synced_commit":"32ee0bb1fc629446a6451f20053c64ce8a860a61"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M3t0r%2Ftpl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M3t0r%2Ftpl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M3t0r%2Ftpl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M3t0r%2Ftpl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/M3t0r","download_url":"https://codeload.github.com/M3t0r/tpl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250451687,"owners_count":21432873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","jinja2","python","unix"],"created_at":"2024-11-10T07:39:16.792Z","updated_at":"2025-04-23T14:31:11.428Z","avatar_url":"https://github.com/M3t0r.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"`tpl`: render templates with data from various sources\n===============================================================\n\n.. image:: https://github.com/M3t0r/tpl/actions/workflows/tests.yaml/badge.svg\n    :target: https://github.com/M3t0r/tpl/actions/workflows/tests.yaml\n    :alt: GitHub Actions build badge\n\n.. image:: https://img.shields.io/pypi/v/tpl.svg\n    :target: https://pypi.python.org/pypi/tpl/\n    :alt: \n\n.. image:: https://readthedocs.org/projects/tpl/badge/\n    :target: https://readthedocs.org/projects/tpl/\n    :alt: Documentation Status\n\nYou want to fill data into a template file?\n\n.. code:: bash\n\n    tpl --yaml data.yaml template.file \u003e rendered.file\n\nYou have everything already set up in your environment and now you just want to\nPOST it somewhere?\n\n.. code:: bash\n\n    tpl structure.json \\\n      | curl \\\n          -X POST \\\n          -H \"Content-Type: application/json\" \\\n          -d@- \\\n          httpbin.org/anything\n\nYou want to fill in a template in your CD pipeline and have access to docker?\n\n.. code:: bash\n\n    echo \"My go-to editor is {{VISUAL}} on {{OS}}\" \\\n      | docker run --rm -i -e \"VISUAL\" -e \"OS=$(uname)\" m3t0r/tpl -\n\nInstallation\n------------\n\n``pip install tpl``, ``docker pull M3t0r/tpl`` or ``make install`` \n\nInput sources\n-------------\n\n`tpl` supports multiple sources:\n * YAML files (``--yaml \u003cfile\u003e``)\n * JSON files (``--json \u003cfile\u003e``)\n * environment variables (``--environment``)\n\nYou can specify multiple sources at once, but if a key is present in more than\none then it's value will be taken from the latter source. This can be useful if\nyou have default values that you want to always be present:\n\n.. code:: bash\n\n    tpl \\\n      --yaml defaults.yaml \\\n      --json \u003c(curl -H \"Content-Type: application/json\" now.httpbin.org) \\\n      template.jinja2 \u003e results.html\n\nUsage\n-----\n.. code::\n\n    Usage:\n      tpl [options] \u003ctemplate_file\u003e\n      tpl --help\n      tpl --version\n    \n    \n    tpl uses the Jinja2 templating engine to render it's output. You can find the\n    documentation for template designers at:\n        http://jinja.pocoo.org/docs/latest/templates/\n    \n    If you provide multiple data sources they will be merged together. If a key is\n    present in more than one source the value of the source that was specified\n    last will be used. Nested objects will be merged with the same algorithm.\n    \n    Options:\n      -e, --environment    Use all environment variables as data\n      --json=\u003cfile\u003e        Load JSON data from a file or STDIN\n      --yaml=\u003cfile\u003e        Load YAML data from a file or STDIN\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm3t0r%2Ftpl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm3t0r%2Ftpl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm3t0r%2Ftpl/lists"}