{"id":23840441,"url":"https://github.com/admk/akpytemp","last_synced_at":"2025-02-22T04:42:50.588Z","repository":{"id":2090223,"uuid":"3030310","full_name":"admk/akpytemp","owner":"admk","description":"A templating utility that I use intensively in other projects.","archived":false,"fork":false,"pushed_at":"2013-11-02T19:19:08.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T17:50:20.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"onevcat/VVDocumenter-Xcode","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/admk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-21T22:46:20.000Z","updated_at":"2013-11-02T19:19:14.000Z","dependencies_parsed_at":"2022-08-20T11:11:14.414Z","dependency_job_id":null,"html_url":"https://github.com/admk/akpytemp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Fakpytemp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Fakpytemp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Fakpytemp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Fakpytemp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/admk","download_url":"https://codeload.github.com/admk/akpytemp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240127088,"owners_count":19751938,"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":"2025-01-02T17:49:11.866Z","updated_at":"2025-02-22T04:42:50.567Z","avatar_url":"https://github.com/admk.png","language":"Python","readme":"akpytemp - A Simple but Awesome General Purpose Templating Utility\n==================================================================\n\nInstallation\n------------\n* Clone from Github\n\n        git clone git@github.com:admk/akpytemp.git akpytemp\n\n* Install by executing\n\n        cd akpytemp\n        python setup.py build\n        python setup.py install\n\nUsage\n-----\n* A hello world example:\n\n        \u003e\u003e\u003e from akpytemp import Template\n        \u003e\u003e\u003e Template('Hello {# world #}, world='world')\n        'Hello world'\n\n* More complex usage\n\n    \u003ccode\u003e12daysofxmas.template\u003c/code\u003e\n\n        {#\n            def ordinal(n):\n                if 10 \u003c n \u003c 14: return u'%sth' % n\n                if n % 10 == 1: return u'%sst' % n\n                if n % 10 == 2: return u'%snd' % n\n                if n % 10 == 3: return u'%srd' % n\n                return u'%sth' % n                      #}\n        {% for d in xrange(1, 13) %}\n        On the {# ordinal(d) #} day of Christmas,\n        my true love sent to me\n        {% if d == 12 %}Twelve drummers drumming,\n        {% end %}{% if d \u003e= 11 %}Eleven pipers piping,\n        {% end %}{% if d \u003e= 10 %}Ten lords a-leaping,\n        {% end %}{% if d \u003e= 9  %}Nine ladies dancing,\n        {% end %}{% if d \u003e= 8  %}Eight maids a-milking,\n        {% end %}{% if d \u003e= 7  %}Seven swans a-swimming,\n        {% end %}{% if d \u003e= 6  %}Six geese a-laying,\n        {% end %}{% if d \u003e= 5  %}Five golden rings,\n        {% end %}{% if d \u003e= 4  %}Four calling birds,\n        {% end %}{% if d \u003e= 3  %}Three French hens,\n        {% end %}{% if d \u003e= 2  %}Two turtle doves,\n        {% end %}{% if d == 1  %}A{% else %}And a{% end %} partridge in a pear tree.\n        {% end %}\n\nRendered result by running \u003ccode\u003epython template.py test/12daysofxmas.template\u003c/code\u003e\n\n        On the 1st day of Christmas,\n        my true love sent to me\n        A partridge in a pear tree.\n\n        On the 2nd day of Christmas,\n        my true love sent to me\n        Two turtle doves,\n        And a partridge in a pear tree.\n\n        On the 3rd day of Christmas,\n        my true love sent to me\n        Three French hens,\n        Two turtle doves,\n        And a partridge in a pear tree.\n        ...\n\n* Built-in functions\n\n    There are many built-in functions available to use in template rendering,\n    simply call them like you would expect in Python, the methods in the\n    template instance will be invoked. For example,\n\n        {# name() #}\n\n    will give the name of the template file being rendered.\n    It is also possible to include template files within a template, this is\n    done by simply using\n\n        {# include('path/to/another_template_file') #}\n\n    The namespaces of the included file will also become available in the\n    parent file.\n    To call built-in functions that belongs to the parent template, simply use\n\n        {# parent.name() #}\n\n    It is possible to extend build-in functions by subclassing Template, any\n    member methods with a name that does not start with '_' will get included\n    for the template.\n\n* Error display\n\n    *akpytemp* has a user friendly error display when an syntax error or an\n    execution exception is caught. It gives a part of your source code\n    highlighting the line that raised the exception with colour output.\n\n        **  Error Occured in file \"src/shifter.v\":\n        NameError: name 'accu_init_str' is not defined\n        **  Source:\n             64 | ...\n             65 |     else\n             66 |     begin\n        --\u003e  67 |         accu = {# accu_init_str #};\n             68 |         accu_prev = {# accu_init_str #};\n             69 |     end\n             70 | ...\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadmk%2Fakpytemp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadmk%2Fakpytemp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadmk%2Fakpytemp/lists"}