{ "info": { "author": "Launchpad Developers", "author_email": "launchpad-dev@lists.launchpad.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "*****************************\npybars: handlebars for python\n*****************************\n\n Copyright (c) 2012, Canonical Ltd\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, version 3 only.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with this program. If not, see .\n GNU Lesser General Public License version 3 (see the file LICENSE).\n \npybars provides a template system for Python which is compatible with\nhandlebars.js.\n\nDependencies\n============\n\n* Python 2.6+\n\n* PyMeta (https://launchpad.net/pymeta)\n\nTesting Dependencies\n====================\n\n* subunit (http://pypi.python.org/pypi/python-subunit) (optional)\n\n* testtools (http://pypi.python.org/pypi/testtools)\n\nUsage\n=====\n\nFor details on the template language see the http://handlebarsjs.com/\ndocumentation.\n\nTranslating the engine to python required slightly different calling\nconventions to the JS version:\n\n* block helpers take (``this``, ``options``, ``*args``, ``**kwargs``)\n\n* other helpers take (``this``, ``*args``, ``**kwargs``)\n\n* closures in the context take (``this``, ``*args``, ``**kwargs``)\n\nA template like '{{foo bar quux=1}}' will pass bar as a positional argument and\nquux as a keyword argument. Keyword arguments have to be non-reserved words in\nPython. For instance, 'print' as a keyword argument will fail.\n\nTemplates with literal boolean arguments like '{{foo true}}' will have the\nargument mapped to Python's True or False as appropriate.\n\nFor efficiency, rather that passing strings round, pybars passes a subclass of\nlist ('liststr') which has a __unicode__ implementation that returns\nu\"\".join(self). Template helpers can return any of list, tuple, unicode or\nliststr instances. liststr exists to avoid quadratic overheads in string\nprocessing during template rendering. Helpers that are in inner loops *should*\nreturn list or liststr for the same reason.\n\n**NOTE** The liststr takes the position of SafeString in the js implementation:\nwhen returning a liststr it will not be escaped, even in a regular {{}}\nexpansion.\n\nThe 'data' facility from the JS implementation has not been ported at this\npoint, if there is demand for it it would be quite easy to add. Similarly\nthe stringParams feature has not been ported - quote anything you wish to force\nto a string in a helper call.\n\nTypical usage:\n\n* Grab a compiler:\n\n >>> from pybars import Compiler\n >>> compiler = Compiler()\n\n* Register any extensions you need:\n\n >>> def _list(this, options, items):\n ... result = [u'')\n ... return result\n >>> compiler.register_helper(u'list', _list)\n\n* And compile your template:\n\n >>> source = u\"{{#list people}}{{firstName}} {{lastName}}{{/list}}\"\n >>> template = compiler.compile(source)\n\n* You can now render it:\n\n >>> template({\n ... 'people': [\n ... {'firstName': \"Yehuda\", 'lastName': \"Katz\"},\n ... {'firstName': \"Carl\", 'lastName': \"Lerche\"},\n ... {'firstName': \"Alan\", 'lastName': \"Johnson\"}\n ... ]})\n \n\nMore details should be found by reading the API docs (e.g. pydoc pybars).\n\nInstallation\n============\n\nEither run setup.py in an environment with all the dependencies available, or\nadd the working directory to your PYTHONPATH.\n\nDevelopment\n===========\n\nUpstream development takes place at https://launchpad.net/pybars.\nTo setup a working area for development, if the dependencies are not\nimmediately available, you can use ./bootstrap.py to create bin/buildout, then\nbin/py to get a python interpreter with the dependencies available.\n\nTo run the tests use the runner of your choice, the test suite is\npybars.tests.test_suite.\n\nFor instance::\n\n $ bin/py -m testtools.run pybars.tests.test_suite\n\npybars is testrepository enabled, so you can just do:\n\n $ testr init\n $ testr run", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://launchpad.net/pybars", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pybars", "package_url": "https://pypi.org/project/pybars/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pybars/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://launchpad.net/pybars" }, "release_url": "https://pypi.org/project/pybars/0.0.4/", "requires_dist": null, "requires_python": null, "summary": "handlebars.js templating for Python.", "version": "0.0.4" }, "last_serial": 5354868, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a603132a72133362d63c756f48e2d7c2", "sha256": "fbd49dd0090d58498824720cf45741c11e657425dc7506c82db78c4f073d28b8" }, "downloads": -1, "filename": "pybars-0.0.1.tar.gz", "has_sig": true, "md5_digest": "a603132a72133362d63c756f48e2d7c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18017, "upload_time": "2012-02-20T02:47:00", "url": "https://files.pythonhosted.org/packages/29/60/a487ec4b37e0639aeee3cac06e22b3a3483609f0d17a1c2238246384908e/pybars-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "8c054bef509c52da42db7c0a3c519b35", "sha256": "a2557e2d690c485a391cc47d55fc7938052a64c8c0b614d75b947b65ab09cf7f" }, "downloads": -1, "filename": "pybars-0.0.2.tar.gz", "has_sig": true, "md5_digest": "8c054bef509c52da42db7c0a3c519b35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18072, "upload_time": "2012-07-30T05:42:36", "url": "https://files.pythonhosted.org/packages/39/b4/9b1008de997224129aba2042867596503f658bd27218a115bcdd74e306a1/pybars-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "1d21da4fcc1136af34be22034b113426", "sha256": "47aeeb5fe4ef28e2bef6ff82374110ade844affd9f44958149696daa1b3d1ea9" }, "downloads": -1, "filename": "pybars-0.0.3.tar.gz", "has_sig": true, "md5_digest": "1d21da4fcc1136af34be22034b113426", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18106, "upload_time": "2012-09-21T00:06:52", "url": "https://files.pythonhosted.org/packages/e3/f2/c2d71fe7920d313bb1a2e3f3bf0941ce06ff6771914974f1034edd21df34/pybars-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "de3e2113bb11bab8a91340f84fae0ca5", "sha256": "a8197e787db051ab6418c3276ef525e45b6955de320202282256c9393d6a699d" }, "downloads": -1, "filename": "pybars-0.0.4.tar.gz", "has_sig": true, "md5_digest": "de3e2113bb11bab8a91340f84fae0ca5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18019, "upload_time": "2012-09-28T05:00:40", "url": "https://files.pythonhosted.org/packages/67/84/e61926cdb9f17576e69a7cf5a505be7dcf479765a821d95449f5d1f4b08a/pybars-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de3e2113bb11bab8a91340f84fae0ca5", "sha256": "a8197e787db051ab6418c3276ef525e45b6955de320202282256c9393d6a699d" }, "downloads": -1, "filename": "pybars-0.0.4.tar.gz", "has_sig": true, "md5_digest": "de3e2113bb11bab8a91340f84fae0ca5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18019, "upload_time": "2012-09-28T05:00:40", "url": "https://files.pythonhosted.org/packages/67/84/e61926cdb9f17576e69a7cf5a505be7dcf479765a821d95449f5d1f4b08a/pybars-0.0.4.tar.gz" } ] }