{"id":21025249,"url":"https://github.com/samvv/templaty","last_synced_at":"2026-04-22T23:32:24.865Z","repository":{"id":57473997,"uuid":"237570644","full_name":"samvv/Templaty","owner":"samvv","description":"Generate programming code using an elegant template language","archived":false,"fork":false,"pushed_at":"2024-02-29T16:35:58.000Z","size":507,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T15:36:15.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://templaty.readthedocs.io/","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/samvv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-02-01T06:03:39.000Z","updated_at":"2024-02-24T23:33:16.000Z","dependencies_parsed_at":"2024-01-27T15:35:18.792Z","dependency_job_id":"ff5fe597-c767-4439-8db9-47e93d49b423","html_url":"https://github.com/samvv/Templaty","commit_stats":{"total_commits":127,"total_committers":2,"mean_commits":63.5,"dds":"0.015748031496062964","last_synced_commit":"0f0c619d929a3d16228d6248ad02fbd55c7a5594"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvv%2FTemplaty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvv%2FTemplaty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvv%2FTemplaty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvv%2FTemplaty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samvv","download_url":"https://codeload.github.com/samvv/Templaty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243456653,"owners_count":20293907,"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":[],"created_at":"2024-11-19T11:31:50.252Z","updated_at":"2025-12-30T01:04:47.073Z","avatar_url":"https://github.com/samvv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Templaty\n========\n\n[![Documentation Status](https://readthedocs.org/projects/templaty/badge/?version=latest)](https://templaty.readthedocs.io/en/latest/?badge=latest)\n\n**Templaty** is a code generator written in Python that focuses on generating\ncorrect and readable programming code. It features fine-grained control over\nwhitespacing and indentation and a rich meta-language that allows full control\nover the end result.\n\n🌈 There now is [a syntax plugin for Neovim][2]!\n\nThe template syntax was inspired by [Jinja2][1] and should be very easy to pick\nup.\n\n```\ndef annoying_prompt():\n    {% for i in range(0, 5) %}\n      prompt(\"Hey, how you're doing?\")\n    {% endfor %}\n```\n\nGenerates the following code:\n\n```python\ndef annoying_prompt():\n    prompt(\"Hey, how you're doing?\")\n    prompt(\"Hey, how you're doing?\")\n    prompt(\"Hey, how you're doing?\")\n    prompt(\"Hey, how you're doing?\")\n    prompt(\"Hey, how you're doing?\")\n```\n\nWhat about generating an [identity matrix][3] in C that imposes no runtime cost?\n\n```\nstatic const int IDENTITY_MATRIX[][] = [\n  {% join i in range(0, 10) with ',' %}\n    [{% join j in range(0, 10) with ',' %}{% if j == i %}1{% else %}0{% endif %}{% endjoin %}]\n  {% endjoin %}\n];\n```\n\nIt should look something like this:\n\n```c\nstatic const int IDENTITY_MATRIX[][] = [\n  [1,0,0,0,0,0,0,0,0,0],\n  [0,1,0,0,0,0,0,0,0,0],\n  [0,0,1,0,0,0,0,0,0,0],\n  [0,0,0,1,0,0,0,0,0,0],\n  [0,0,0,0,1,0,0,0,0,0],\n  [0,0,0,0,0,1,0,0,0,0],\n  [0,0,0,0,0,0,1,0,0,0],\n  [0,0,0,0,0,0,0,1,0,0],\n  [0,0,0,0,0,0,0,0,1,0],\n  [0,0,0,0,0,0,0,0,0,1]\n];\n```\n\nThis is just the tip of the iceberg of what Templaty can do!\n\n## Usage\n\nTemplaty is available on PyPi. You can issue the following command to install it:\n\n```sh\npip3 install -U --user templaty\n```\n\nThis should make the main command `templaty` available in your terminal.\n\nThis should make the main command `templaty` available in your terminal.\n\n## IDE Integration\n\n### Neovim\n\nThere is a [Templaty plugin][2] available \nthat is easy to set up.\n\n## FAQ\n\n### Will this library support Python 2?\n\nNo. Python 2 has reached its end-of-life and the organisation recommends\neveryone to upgrade to Python 3. Porting to Python 2 requires extra work\nfor no good reason.\n\n### Is it safe to use this library in my web server?\n\nNo, absolutely not! Templaty is a tool meant to be run by developers, not\nend-users. As such, it has little (if any) security checks. You should never\nrun untrusted input using Templaty, only code you wrote yourself or from a\ndeveloper you trust.\n\n### What extension should I use for my template files?\n\nIt is recommended to use the `.tply` extension so that syntax plugins like \n[vim-templaty][2] automatically set up the right syntax highlighting for you.\n\nIf your template contains code in another programming language, simply prefix\nthe default file extension to `.tply`, e.g. `mytemplate.cc.tply`.\n\n## License\n\nTemplaty is licensed under the Apache 2.0 license, in the hope it will help developers\nwrite better programs.\n\n[1]: https://jinja.palletsprojects.com/\n[2]: https://github.com/samvv/templaty.nvim\n[3]: https://en.wikipedia.org/wiki/Identity_matrix\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamvv%2Ftemplaty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamvv%2Ftemplaty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamvv%2Ftemplaty/lists"}