{ "info": { "author": "Jack Stephenson", "author_email": "jack@bancast.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: PyPy" ], "description": ".. Do not edit this file. This file is auto-generated for PyPI by setup.py\n.. using pandoc, so edits should go in the source files rather than here.\n\nPystache\n========\n\n.. figure:: http://defunkt.github.com/pystache/images/logo_phillips.png\n :alt: mustachioed, monocled snake by David Phillips\n\n.. figure:: https://secure.travis-ci.org/defunkt/pystache.png\n :alt: Travis CI current build status\n\n`Pystache `_ is a Python\nimplementation of `Mustache `_. Mustache is\na framework-agnostic, logic-free templating system inspired by\n`ctemplate `_ and\n`et `_.\nLike ctemplate, Mustache \"emphasizes separating logic from presentation:\nit is impossible to embed application logic in this template language.\"\n\nThe `mustache(5) `_ man page\nprovides a good introduction to Mustache's syntax. For a more complete\n(and more current) description of Mustache's behavior, see the official\n`Mustache spec `_.\n\nPystache is `semantically versioned `_ and can be\nfound on `PyPI `_. This version of\nPystache passes all tests in `version\n1.1.2 `_ of the spec.\n\nRequirements\n------------\n\nPystache is tested with--\n\n- Python 2.4 (requires simplejson `version\n 2.0.9 `_ or earlier)\n- Python 2.5 (requires\n `simplejson `_)\n- Python 2.6\n- Python 2.7\n- Python 3.1\n- Python 3.2\n- Python 3.3\n- `PyPy `_\n\n`Distribute `_ (the setuptools\nfork) is recommended over\n`setuptools `_, and is required\nin some cases (e.g. for Python 3 support). If you use\n`pip `_, you probably already satisfy\nthis requirement.\n\nJSON support is needed only for the command-line interface and to run\nthe spec tests. We require simplejson for earlier versions of Python\nsince Python's `json `_ module\nwas added in Python 2.6.\n\nFor Python 2.4 we require an earlier version of simplejson since\nsimplejson stopped officially supporting Python 2.4 in simplejson\nversion 2.1.0. Earlier versions of simplejson can be installed manually,\nas follows:\n\n::\n\n pip install 'simplejson<2.1.0'\n\nOfficial support for Python 2.4 will end with Pystache version 0.6.0.\n\nInstall It\n----------\n\n::\n\n pip install pystache\n\nAnd test it--\n\n::\n\n pystache-test\n\nTo install and test from source (e.g. from GitHub), see the Develop\nsection.\n\nUse It\n------\n\n::\n\n >>> import pystache\n >>> print pystache.render('Hi {{person}}!', {'person': 'Mom'})\n Hi Mom!\n\nYou can also create dedicated view classes to hold your view logic.\n\nHere's your view class (in .../examples/readme.py):\n\n::\n\n class SayHello(object):\n def to(self):\n return \"Pizza\"\n\nInstantiating like so:\n\n::\n\n >>> from pystache.tests.examples.readme import SayHello\n >>> hello = SayHello()\n\nThen your template, say\\_hello.mustache (by default in the same\ndirectory as your class definition):\n\n::\n\n Hello, {{to}}!\n\nPull it together:\n\n::\n\n >>> renderer = pystache.Renderer()\n >>> print renderer.render(hello)\n Hello, Pizza!\n\nFor greater control over rendering (e.g. to specify a custom template\ndirectory), use the ``Renderer`` class like above. One can pass\nattributes to the Renderer class constructor or set them on a Renderer\ninstance. To customize template loading on a per-view basis, subclass\n``TemplateSpec``. See the docstrings of the\n`Renderer `_\nclass and\n`TemplateSpec `_\nclass for more information.\n\nYou can also pre-parse a template:\n\n::\n\n >>> parsed = pystache.parse(u\"Hey {{#who}}{{.}}!{{/who}}\")\n >>> print parsed\n [u'Hey ', _SectionNode(key=u'who', index_begin=12, index_end=18, parsed=[_EscapeNode(key=u'.'), u'!'])]\n\nAnd then:\n\n::\n\n >>> print renderer.render(parsed, {'who': 'Pops'})\n Hey Pops!\n >>> print renderer.render(parsed, {'who': 'you'})\n Hey you!\n\nPython 3\n--------\n\nPystache has supported Python 3 since version 0.5.1. Pystache behaves\nslightly differently between Python 2 and 3, as follows:\n\n- In Python 2, the default html-escape function ``cgi.escape()`` does\n not escape single quotes. In Python 3, the default escape function\n ``html.escape()`` does escape single quotes.\n- In both Python 2 and 3, the string and file encodings default to\n ``sys.getdefaultencoding()``. However, this function can return\n different values under Python 2 and 3, even when run from the same\n system. Check your own system for the behavior on your system, or do\n not rely on the defaults by passing in the encodings explicitly (e.g.\n to the ``Renderer`` class).\n\nUnicode\n-------\n\nThis section describes how Pystache handles unicode, strings, and\nencodings.\n\nInternally, Pystache uses `only unicode\nstrings `_\n(``str`` in Python 3 and ``unicode`` in Python 2). For input, Pystache\naccepts both unicode strings and byte strings (``bytes`` in Python 3 and\n``str`` in Python 2). For output, Pystache's template rendering methods\nreturn only unicode.\n\nPystache's ``Renderer`` class supports a number of attributes to control\nhow Pystache converts byte strings to unicode on input. These include\nthe ``file_encoding``, ``string_encoding``, and ``decode_errors``\nattributes.\n\nThe ``file_encoding`` attribute is the encoding the renderer uses to\nconvert to unicode any files read from the file system. Similarly,\n``string_encoding`` is the encoding the renderer uses to convert any\nother byte strings encountered during the rendering process into unicode\n(e.g. context values that are encoded byte strings).\n\nThe ``decode_errors`` attribute is what the renderer passes as the\n``errors`` argument to Python's built-in unicode-decoding function\n(``str()`` in Python 3 and ``unicode()`` in Python 2). The valid values\nfor this argument are ``strict``, ``ignore``, and ``replace``.\n\nEach of these attributes can be set via the ``Renderer`` class's\nconstructor using a keyword argument of the same name. See the Renderer\nclass's docstrings for further details. In addition, the\n``file_encoding`` attribute can be controlled on a per-view basis by\nsubclassing the ``TemplateSpec`` class. When not specified explicitly,\nthese attributes default to values set in Pystache's ``defaults``\nmodule.\n\nDevelop\n-------\n\nTo test from a source distribution (without installing)--\n\n::\n\n python test_pystache.py\n\nTo test Pystache with multiple versions of Python (with a single\ncommand!), you can use `tox `_:\n\n::\n\n pip install 'virtualenv<1.8' # Version 1.8 dropped support for Python 2.4.\n pip install 'tox<1.4' # Version 1.4 dropped support for Python 2.4.\n tox\n\nIf you do not have all Python versions listed in ``tox.ini``--\n\n::\n\n tox -e py26,py32 # for example\n\nThe source distribution tests also include doctests and tests from the\nMustache spec. To include tests from the Mustache spec in your test\nruns:\n\n::\n\n git submodule init\n git submodule update\n\nThe test harness parses the spec's (more human-readable) yaml files if\n`PyYAML `_ is present. Otherwise, it\nparses the json files. To install PyYAML--\n\n::\n\n pip install pyyaml\n\nTo run a subset of the tests, you can use\n`nose `_:\n\n::\n\n pip install nose\n nosetests --tests pystache/tests/test_context.py:GetValueTests.test_dictionary__key_present\n\nUsing Python 3 with Pystache from source\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPystache is written in Python 2 and must be converted to Python 3 prior\nto using it with Python 3. The installation process (and tox) do this\nautomatically.\n\nTo convert the code to Python 3 manually (while using Python 3)--\n\n::\n\n python setup.py build\n\nThis writes the converted code to a subdirectory called ``build``. By\ndesign, Python 3 builds\n`cannot `_\nbe created from Python 2.\n\nTo convert the code without using setup.py, you can use\n`2to3 `_ as follows (two\nsteps)--\n\n::\n\n 2to3 --write --nobackups --no-diffs --doctests_only pystache\n 2to3 --write --nobackups --no-diffs pystache\n\nThis converts the code (and doctests) in place.\n\nTo ``import pystache`` from a source distribution while using Python 3,\nbe sure that you are importing from a directory containing a converted\nversion of the code (e.g. from the ``build`` directory after\nconverting), and not from the original (unconverted) source directory.\nOtherwise, you will get a syntax error. You can help prevent this by not\nrunning the Python IDE from the project directory when importing\nPystache while using Python 3.\n\nMailing List\n------------\n\nThere is a `mailing list `_.\nNote that there is a bit of a delay between posting a message and seeing\nit appear in the mailing list archive.\n\nCredits\n-------\n\n::\n\n >>> context = { 'author': 'Chris Wanstrath', 'maintainer': 'Chris Jerdonek' }\n >>> print pystache.render(\"Author: {{author}}\\nMaintainer: {{maintainer}}\", context)\n Author: Chris Wanstrath\n Maintainer: Chris Jerdonek\n\nPystache logo by `David Phillips `_ is\nlicensed under a `Creative Commons Attribution-ShareAlike 3.0 Unported\nLicense `_.\n|image0|\n\nHistory\n=======\n\n**Note:** Official support for Python 2.4 will end with Pystache version\n0.6.0.\n\n0.5.3 (2012-11-03)\n------------------\n\n- Added ability to customize string coercion (e.g. to have None render\n as ``''``) (issue #130).\n- Added Renderer.render\\_name() to render a template by name (issue\n #122).\n- Added TemplateSpec.template\\_path to specify an absolute path to a\n template (issue #41).\n- Added option of raising errors on missing tags/partials:\n ``Renderer(missing_tags='strict')`` (issue #110).\n- Added support for finding and loading templates by file name in\n addition to by template name (issue #127). [xgecko]\n- Added a ``parse()`` function that yields a printable, pre-compiled\n parse tree.\n- Added support for rendering pre-compiled templates.\n- Added Python 3.3 to the list of supported versions.\n- Added support for `PyPy `_ (issue #125).\n- Added support for `Travis CI `_ (issue #124).\n [msabramo]\n- Bugfix: ``defaults.DELIMITERS`` can now be changed at runtime (issue\n #135). [bennoleslie]\n- Bugfix: exceptions raised from a property are no longer swallowed\n when getting a key from a context stack (issue #110).\n- Bugfix: lambda section values can now return non-ascii, non-unicode\n strings (issue #118).\n- Bugfix: allow ``test_pystache.py`` and ``tox`` to pass when run from\n a downloaded sdist (i.e. without the spec test directory).\n- Convert HISTORY and README files from reST to Markdown.\n- More robust handling of byte strings in Python 3.\n- Added Creative Commons license for David Phillips's logo.\n\n0.5.2 (2012-05-03)\n------------------\n\n- Added support for dot notation and version 1.1.2 of the spec (issue\n #99). [rbp]\n- Missing partials now render as empty string per latest version of\n spec (issue #115).\n- Bugfix: falsey values now coerced to strings using str().\n- Bugfix: lambda return values for sections no longer pushed onto\n context stack (issue #113).\n- Bugfix: lists of lambdas for sections were not rendered (issue #114).\n\n0.5.1 (2012-04-24)\n------------------\n\n- Added support for Python 3.1 and 3.2.\n- Added tox support to test multiple Python versions.\n- Added test script entry point: pystache-test.\n- Added \\_\\_version\\_\\_ package attribute.\n- Test harness now supports both YAML and JSON forms of Mustache spec.\n- Test harness no longer requires nose.\n\n0.5.0 (2012-04-03)\n------------------\n\nThis version represents a major rewrite and refactoring of the code base\nthat also adds features and fixes many bugs. All functionality and\nnearly all unit tests have been preserved. However, some backwards\nincompatible changes to the API have been made.\n\nBelow is a selection of some of the changes (not exhaustive).\n\nHighlights:\n\n- Pystache now passes all tests in version 1.0.3 of the `Mustache\n spec `_. [pvande]\n- Removed View class: it is no longer necessary to subclass from View\n or from any other class to create a view.\n- Replaced Template with Renderer class: template rendering behavior\n can be modified via the Renderer constructor or by setting attributes\n on a Renderer instance.\n- Added TemplateSpec class: template rendering can be specified on a\n per-view basis by subclassing from TemplateSpec.\n- Introduced separation of concerns and removed circular dependencies\n (e.g. between Template and View classes, cf. `issue\n #13 `_).\n- Unicode now used consistently throughout the rendering process.\n- Expanded test coverage: nosetests now runs doctests and ~105 test\n cases from the Mustache spec (increasing the number of tests from 56\n to ~315).\n- Added a rudimentary benchmarking script to gauge performance while\n refactoring.\n- Extensive documentation added (e.g. docstrings).\n\nOther changes:\n\n- Added a command-line interface. [vrde]\n- The main rendering class now accepts a custom partial loader (e.g. a\n dictionary) and a custom escape function.\n- Non-ascii characters in str strings are now supported while\n rendering.\n- Added string encoding, file encoding, and errors options for decoding\n to unicode.\n- Removed the output encoding option.\n- Removed the use of markupsafe.\n\nBug fixes:\n\n- Context values no longer processed as template strings.\n [jakearchibald]\n- Whitespace surrounding sections is no longer altered, per the spec.\n [heliodor]\n- Zeroes now render correctly when using PyPy. [alex]\n- Multline comments now permitted. [fczuardi]\n- Extensionless template files are now supported.\n- Passing ``**kwargs`` to ``Template()`` no longer modifies the\n context.\n- Passing ``**kwargs`` to ``Template()`` with no context no longer\n raises an exception.\n\n0.4.1 (2012-03-25)\n------------------\n\n- Added support for Python 2.4. [wangtz, jvantuyl]\n\n0.4.0 (2011-01-12)\n------------------\n\n- Add support for nested contexts (within template and view)\n- Add support for inverted lists\n- Decoupled template loading\n\n0.3.1 (2010-05-07)\n------------------\n\n- Fix package\n\n0.3.0 (2010-05-03)\n------------------\n\n- View.template\\_path can now hold a list of path\n- Add {{& blah}} as an alias for {{{ blah }}}\n- Higher Order Sections\n- Inverted sections\n\n0.2.0 (2010-02-15)\n------------------\n\n- Bugfix: Methods returning False or None are not rendered\n- Bugfix: Don't render an empty string when a tag's value is 0.\n [enaeseth]\n- Add support for using non-callables as View attributes.\n [joshthecoder]\n- Allow using View instances as attributes. [joshthecoder]\n- Support for Unicode and non-ASCII-encoded bytestring output.\n [enaeseth]\n- Template file encoding awareness. [enaeseth]\n\n0.1.1 (2009-11-13)\n------------------\n\n- Ensure we're dealing with strings, always\n- Tests can be run by executing the test file directly\n\n0.1.0 (2009-11-12)\n------------------\n\n- First release\n\nLicense\n=======\n\nCopyright (C) 2012 Chris Jerdonek. All rights reserved.\n\nCopyright (c) 2009 Chris Wanstrath\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n.. |image0| image:: http://i.creativecommons.org/l/by-sa/3.0/88x31.png", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jackatbancast/pymstache", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pymstache", "package_url": "https://pypi.org/project/pymstache/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pymstache/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/jackatbancast/pymstache" }, "release_url": "https://pypi.org/project/pymstache/0.5.3/", "requires_dist": null, "requires_python": null, "summary": "Mustache for Python", "version": "0.5.3" }, "last_serial": 753563, "releases": { "0.5.3": [ { "comment_text": "", "digests": { "md5": "264b5e9dbd3796ddaa940e2130854130", "sha256": "6365c3bcb3fd00d67bbbf5daab2554e69f51f873db6eb81b70ab4bcef6b45e4e" }, "downloads": -1, "filename": "pymstache-0.5.3.tar.gz", "has_sig": false, "md5_digest": "264b5e9dbd3796ddaa940e2130854130", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 71290, "upload_time": "2013-06-05T17:36:01", "url": "https://files.pythonhosted.org/packages/1b/f2/10d1d73f35288edfa8fe35c68f6dc00cb79566ec274e6c5182e1c83df006/pymstache-0.5.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "264b5e9dbd3796ddaa940e2130854130", "sha256": "6365c3bcb3fd00d67bbbf5daab2554e69f51f873db6eb81b70ab4bcef6b45e4e" }, "downloads": -1, "filename": "pymstache-0.5.3.tar.gz", "has_sig": false, "md5_digest": "264b5e9dbd3796ddaa940e2130854130", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 71290, "upload_time": "2013-06-05T17:36:01", "url": "https://files.pythonhosted.org/packages/1b/f2/10d1d73f35288edfa8fe35c68f6dc00cb79566ec274e6c5182e1c83df006/pymstache-0.5.3.tar.gz" } ] }