{ "info": { "author": "Luke Stebbing", "author_email": "luke@lukestebbing.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "ScopeFormatter allows Python's string formatting to be used with names\r\ndrawn from the current scope, similar to the variable interpolation\r\nfound in languages such as Ruby and Perl.\r\n\r\n\r\n.. contents::\r\n\r\n\r\nExamples\r\n--------\r\n>>> from scopeformatter import F\r\n>>> greeting = 'Hello'\r\n>>> def greet(name):\r\n... return F('{greeting}, {name}!')\r\n>>> greet('world')\r\n'Hello, world!'\r\n\r\nPositional and keyword arguments are accepted:\r\n\r\n>>> F('{greeting} {0} times, {name}!', len(greeting), name='world')\r\n'Hello 5 times, world!'\r\n\r\n\r\nRequirements\r\n------------\r\nThe stack inspection requires a Python VM that provides\r\n``sys._getframe()``, such as CPython.\r\n\r\n\r\nLimitations\r\n-----------\r\nNon-global names from enclosing scopes will not be found unless\r\nthey are referenced in the local scope.\r\n\r\n>>> def outer():\r\n... non_local = 'non-local'\r\n... def inner():\r\n... return F('{non_local} is not referenced locally')\r\n... return inner()\r\n>>> outer()\r\nTraceback (most recent call last):\r\n ...\r\nKeyError: 'non_local'\r\n\r\n>>> def outer():\r\n... non_local = 'non-local'\r\n... def inner():\r\n... non_local\r\n... return F('{non_local} is referenced locally')\r\n... return inner()\r\n>>> outer()\r\n'non-local is referenced locally'\r\n\r\n\r\nHistory\r\n-------\r\n\r\n\r\n1.0.3 -- 2009 Oct 22\r\n====================\r\n- Added history to the project page.\r\n- Added additional documentation files.\r\n\r\n\r\n1.0.2 -- 2009 Oct 22\r\n====================\r\n- Reorganized metadata.\r\n- Removed dependencies on setuptools and nose.\r\n\r\n\r\n1.0.1 -- 2009 Oct 3\r\n===================\r\n- Made minor additions to metadata.\r\n\r\n\r\n1.0 -- 2009 Sept 25\r\n===================\r\n- Initial release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/ScopeFormatter", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ScopeFormatter", "package_url": "https://pypi.org/project/ScopeFormatter/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ScopeFormatter/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/ScopeFormatter" }, "release_url": "https://pypi.org/project/ScopeFormatter/1.0.3/", "requires_dist": null, "requires_python": null, "summary": "Format a string using names in the current scope.", "version": "1.0.3" }, "last_serial": 743274, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c5495edb54272f6a59c841acfb59e677", "sha256": "9a28088a9cd79718f47a19e22900006dec1ab7e450ea080a9ec50478c925d115" }, "downloads": -1, "filename": "ScopeFormatter-1.0.tar.gz", "has_sig": true, "md5_digest": "c5495edb54272f6a59c841acfb59e677", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2745, "upload_time": "2009-09-25T01:06:30", "url": "https://files.pythonhosted.org/packages/e8/8c/8dfed20a1709c34694376317bb76b28f3ea1bde71cff763f5156fa86eb1e/ScopeFormatter-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "885205cc25470770a243d90053de0aef", "sha256": "736cb77fb033de9532408032d012f6c4fb7232f1557c876912060a3d3da1747c" }, "downloads": -1, "filename": "ScopeFormatter-1.0.1.tar.gz", "has_sig": true, "md5_digest": "885205cc25470770a243d90053de0aef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2803, "upload_time": "2009-10-03T04:50:05", "url": "https://files.pythonhosted.org/packages/86/03/e565d129a737be4613d90220b21bca8bfbfec9d107cb1501a141af55e880/ScopeFormatter-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "359ac2ad3e024d801988744b56a7c824", "sha256": "cf2a855fa03443c8b3659171de3ea8108e5073c0c701fb5ddea752edca600209" }, "downloads": -1, "filename": "ScopeFormatter-1.0.2.tar.gz", "has_sig": true, "md5_digest": "359ac2ad3e024d801988744b56a7c824", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1910, "upload_time": "2009-10-23T05:11:47", "url": "https://files.pythonhosted.org/packages/8b/03/bca2ed1aec8ac480a0c5ac1e3574666bdbdcaa4e4df1c4dfbb4a463e6a28/ScopeFormatter-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "1603fa0edea650b63f71f464d8485b98", "sha256": "73b60fb05eb93e71bef119840b70d88c358136450a466bfd5d471b8b148598a8" }, "downloads": -1, "filename": "ScopeFormatter-1.0.3.tar.gz", "has_sig": true, "md5_digest": "1603fa0edea650b63f71f464d8485b98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3068, "upload_time": "2009-10-23T06:43:34", "url": "https://files.pythonhosted.org/packages/2f/a7/238ff037ae2be90a1cf77db1962a318287e6e0f610a4e9847c704e25f395/ScopeFormatter-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1603fa0edea650b63f71f464d8485b98", "sha256": "73b60fb05eb93e71bef119840b70d88c358136450a466bfd5d471b8b148598a8" }, "downloads": -1, "filename": "ScopeFormatter-1.0.3.tar.gz", "has_sig": true, "md5_digest": "1603fa0edea650b63f71f464d8485b98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3068, "upload_time": "2009-10-23T06:43:34", "url": "https://files.pythonhosted.org/packages/2f/a7/238ff037ae2be90a1cf77db1962a318287e6e0f610a4e9847c704e25f395/ScopeFormatter-1.0.3.tar.gz" } ] }