{ "info": { "author": "Tudor Aursulesei", "author_email": "thestick613@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Documentation", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Installation/Setup", "Topic :: System :: Software Distribution" ], "description": "===========================\nUltra Fast Template Library\n===========================\n\nThis project provides a library which allows for very flexible and fast template renderings at the expense of security.\nIt uses python code to generate variables which are then substituted in a string.Template.\n\nExamples\n========\n\nHere's a basic example:\n\n.. code-block:: python\n\n from uftlib import UFTemplate\n\n initial = \"\"\"import datetime\n def f(x):\n return x*x\n \n def getnow():\n return str(datetime.datetime.now())\n \n a = 0\n b = 100\n i = 0\"\"\"\n \n oncycle = \"\"\"a += 3\n i += 1\n s = f(i)\n b += a\n now = getnow()\"\"\"\n\n template = \"\"\"Now = ${now}\n Render nr. ${i}\n f(${i}) = ${s}\n b = ${b}\n We live in ${where}\"\"\"\n\n tpl = UFTemplate(initial, oncycle, template, where=\"Indonezia\")\n for text in tpl.render_many(1):\n print(text)\n\nWe should get the following output:\n\n::\n\n Now = 2015-08-25 16:09:07.015948\n Render nr. 1\n f(1) = 1\n b = 103\n We live in Indonezia\n\nWe can reset the template to it's initial state and obtain the same results:\n\n.. code-block:: python\n\n tpl.reset()\n for text in tpl.render_many(2):\n print(text)\n\nYou should get the following output:\n\n::\n\n Now = 2015-08-25 16:09:07.016970\n Render nr. 1\n f(1) = 1\n b = 103\n We live in Indonezia\n Now = 2015-08-25 16:09:07.017298\n Render nr. 2\n f(2) = 4\n b = 109\n We live in Indonezia\n\n\nWarning\n=======\n\nYou can put any kind of python code in the initial section, such as open and read web pages,\nconnect to databases, read and parse other files, but this comes at the expense of security,\nas malitious code will be run on the same environment as the interpreter. This is a tradeoff\nwhich is not advantageous for all projects and needs, so use this library at your own expense.\n\n\nFlexibility\n===========\n\nThe three required arguments (initial, oncycle and template) may be stored on a database and\nmay be retrieved by multiple programs in the network, which parallelize and distribute the task.\nMost templating engines store some of the logic in the template and some of it in the code which\ncalls the template render, leading to a big mess. Use uftlib to cut that corner.", "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/thestick613/uftlib", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "uftlib", "package_url": "https://pypi.org/project/uftlib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/uftlib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/thestick613/uftlib" }, "release_url": "https://pypi.org/project/uftlib/0.2/", "requires_dist": null, "requires_python": null, "summary": "Uses python eval, string.Template to generate text very fast.", "version": "0.2" }, "last_serial": 2069590, "releases": { "0.1": [], "0.2": [ { "comment_text": "", "digests": { "md5": "85401745eeab80e4d559a4487f90b74e", "sha256": "3cc697bd7cac579aba0c59a65e7761482ea59713f10f3b22c2de6769ab92dbd9" }, "downloads": -1, "filename": "uftlib-0.2.tar.gz", "has_sig": false, "md5_digest": "85401745eeab80e4d559a4487f90b74e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18068, "upload_time": "2016-04-18T14:33:41", "url": "https://files.pythonhosted.org/packages/3e/9f/fc2e635387c914c677dc311a8fc88065478b4b61c257936c144cb45795c0/uftlib-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "85401745eeab80e4d559a4487f90b74e", "sha256": "3cc697bd7cac579aba0c59a65e7761482ea59713f10f3b22c2de6769ab92dbd9" }, "downloads": -1, "filename": "uftlib-0.2.tar.gz", "has_sig": false, "md5_digest": "85401745eeab80e4d559a4487f90b74e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18068, "upload_time": "2016-04-18T14:33:41", "url": "https://files.pythonhosted.org/packages/3e/9f/fc2e635387c914c677dc311a8fc88065478b4b61c257936c144cb45795c0/uftlib-0.2.tar.gz" } ] }