{ "info": { "author": "Thomas", "author_email": "lyanghwy@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=========================\nChoco Templates for Python\n=========================\n\nChoco is a template library written in Python. It provides a familiar, non-XML \nsyntax which compiles into Python modules for maximum performance. Choco's \nsyntax and API borrows from the best ideas of many others, including Django\ntemplates, Cheetah, Myghty, and Genshi. Conceptually, Choco is an embedded \nPython (i.e. Python Server Page) language, which refines the familiar ideas\nof componentized layout and inheritance to produce one of the most \nstraightforward and flexible models available, while also maintaining close \nties to Python calling and scoping semantics.\n\nNutshell\n========\n\n::\n\n <%inherit file=\"base.html\"/>\n <%\n rows = [[v for v in range(0,10)] for row in range(0,10)]\n %>\n \n % for row in rows:\n ${makerow(row)}\n % endfor\n
\n\n <%def name=\"makerow(row)\">\n \n % for name in row:\n ${name}\\\n % endfor\n \n \n\nUI \n============\n\n\n\nUI tag is inspired by EmberJs Handlebarjs tempalte.\n\n\nindex.html\n----------------\n\n\n::\n\n This is an UI Page\n <%@ PostView(post_id)/>\n\n\n\nui/post.html\n----------------\n\n\n::\n\n This is a Post View\n\n Name: ${post.title}\n Content: ${post.content}\n \n\n.. code:: python\n\n\n def create_ui_container():\n from choco.ui import UIContainer, UIModule\n ui_container = UIContainer([\"template/ui\"])\n\n class PostView(UIModule):\n\n default_template = \"post.html\"\n\n def initialize(self):\n self.thing = Thing(\"Post\")\n\n def render(self, post_id):\n post = self.thing.getByPostId(post_id)\n return {\n \"post\": post\n }\n ui_container.put_ui(\"PostView\", PostView)\n return ui_container\n\n tl2 = lookup.TemplateLookup(directories=[\"template\"], ui_container=create_ui_container())\n t12.get_template(\"index.html\").render(post_id=122)\n\n\n\n\n\nPhilosophy\n===========\n\nPython is a great scripting language. Don't reinvent the wheel...your templates can handle it !\n\n\n\nLicense\n========\n\nChoco is licensed under an MIT-style license (see LICENSE).\nOther incorporated projects may be licensed under different licenses.\nAll licenses allow for non-commercial and commercial use.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/whiteclover/Choco", "keywords": "templates", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Choco", "package_url": "https://pypi.org/project/Choco/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Choco/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/whiteclover/Choco" }, "release_url": "https://pypi.org/project/Choco/1.0.5/", "requires_dist": null, "requires_python": null, "summary": "A super-fast templating language that borrows the best ideas from the existing templating languages.", "version": "1.0.5" }, "last_serial": 2137862, "releases": { "1.0.4": [ { "comment_text": "", "digests": { "md5": "13134396b8a8c667a946ec86c493cea7", "sha256": "6a42bf91b8d97b8945b907f458f379d89b9bc083b87f6f423bb5c64a9cad3fc7" }, "downloads": -1, "filename": "Choco-1.0.4.tar.gz", "has_sig": false, "md5_digest": "13134396b8a8c667a946ec86c493cea7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 213162, "upload_time": "2016-04-10T03:01:38", "url": "https://files.pythonhosted.org/packages/bd/ea/13b525f59d0d02d795c22b50a09dad619c0630b55d0b7f26fbb3361d783c/Choco-1.0.4.tar.gz" }, { "comment_text": "", "digests": { "md5": "1414a30eb4b679ae7fcba1e82e5ceebd", "sha256": "d84b22a5d2e4b4d8d59928c7f5442fa9699754e3c6688944e5e74d0ccd8ce266" }, "downloads": -1, "filename": "Choco-1.0.4.zip", "has_sig": false, "md5_digest": "1414a30eb4b679ae7fcba1e82e5ceebd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 252471, "upload_time": "2016-04-10T03:01:27", "url": "https://files.pythonhosted.org/packages/34/49/f7ce2860c89a2bc0e90f747e07e8b5f8c0a59483bf817bd8c3f9246f39e0/Choco-1.0.4.zip" } ], "1.0.4.dev0": [], "1.0.5": [ { "comment_text": "", "digests": { "md5": "86e748041f5cab65f5a98e16cba937d6", "sha256": "a51b7f9f7bb91c3925135ec4b973201a05a72da2d5cac068a13720391c8b08ae" }, "downloads": -1, "filename": "Choco-1.0.5.tar.gz", "has_sig": false, "md5_digest": "86e748041f5cab65f5a98e16cba937d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 214471, "upload_time": "2016-05-28T04:35:55", "url": "https://files.pythonhosted.org/packages/98/41/c270306772b9459020b44eca26d995903919b3488f096950460ff7fd58d8/Choco-1.0.5.tar.gz" }, { "comment_text": "", "digests": { "md5": "7dc7576ced69c134ef4c3925ee597cd9", "sha256": "cc5f4d9eafc202013f0f2821a464a43512b265c2bc923a08e75b0427490e31df" }, "downloads": -1, "filename": "Choco-1.0.5.zip", "has_sig": false, "md5_digest": "7dc7576ced69c134ef4c3925ee597cd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 254781, "upload_time": "2016-05-28T04:35:45", "url": "https://files.pythonhosted.org/packages/23/db/2028a7a0e838be7cddb55eed7305d5418c577e854d76a0a0c93c3adcf5fe/Choco-1.0.5.zip" } ], "1.0.5.dev0": [] }, "urls": [ { "comment_text": "", "digests": { "md5": "86e748041f5cab65f5a98e16cba937d6", "sha256": "a51b7f9f7bb91c3925135ec4b973201a05a72da2d5cac068a13720391c8b08ae" }, "downloads": -1, "filename": "Choco-1.0.5.tar.gz", "has_sig": false, "md5_digest": "86e748041f5cab65f5a98e16cba937d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 214471, "upload_time": "2016-05-28T04:35:55", "url": "https://files.pythonhosted.org/packages/98/41/c270306772b9459020b44eca26d995903919b3488f096950460ff7fd58d8/Choco-1.0.5.tar.gz" }, { "comment_text": "", "digests": { "md5": "7dc7576ced69c134ef4c3925ee597cd9", "sha256": "cc5f4d9eafc202013f0f2821a464a43512b265c2bc923a08e75b0427490e31df" }, "downloads": -1, "filename": "Choco-1.0.5.zip", "has_sig": false, "md5_digest": "7dc7576ced69c134ef4c3925ee597cd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 254781, "upload_time": "2016-05-28T04:35:45", "url": "https://files.pythonhosted.org/packages/23/db/2028a7a0e838be7cddb55eed7305d5418c577e854d76a0a0c93c3adcf5fe/Choco-1.0.5.zip" } ] }