{ "info": { "author": "Syrus Akbary", "author_email": "me@syrusakbary.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Interpy = Python String Interpolation\r\n=====================================\r\n\r\nInterpy **extends Python** to support *Ruby like* string interpolation\r\n**#{}**. Quick example: ``print \"Hello #{your_name}\"``\r\n\r\nIt is **hightly optimized**, and directly compiled to bytecode, so you\r\nwill have the same Python speed when using it.\r\n\r\nInstallation\r\n------------\r\n\r\nThe installation of this package is quite simple, you only have to run\r\n``pip install interpy``.\r\n\r\nUsage\r\n-----\r\n\r\nAll python files with string interpolation must have the following first\r\nline\r\n\r\n.. code:: python\r\n\r\n # coding: interpy\r\n\r\nExample:\r\n\r\n.. code:: python\r\n\r\n # coding: interpy\r\n\r\n package = \"Interpy\"\r\n print \"Enjoy #{package}!\"\r\n\r\nHow it works\r\n------------\r\n\r\n*This package is inspired in Dropbox `pyxl template engine`_.*\r\n\r\nParsing\r\n~~~~~~~\r\n\r\nInterpy uses support for specifying source code encodings as described\r\nin `PEP 263`_ to do what it does. The functionality was originally\r\nprovided so that python developers could write code in non-ascii\r\nlanguages (eg. chinese variable names). Interpy creates a custom\r\nencoding called interpy which allows it to convert interpolated strings\r\ninto regular python before the file is compiled. Once the interpy codec\r\nis registered, any file starting with ``# coding: interpy`` is run\r\nthrough the interpy parser before compilation.\r\n\r\nCompiling\r\n~~~~~~~~~\r\n\r\nThe above example would be compiled to this (in *bytecode*):\r\n\r\n.. code:: python\r\n\r\n # coding: interpy\r\n\r\n package = \"Interpy\"\r\n print \"Enjoy \"+str(package)+\"!\"\r\n\r\n\r\nCompatibility\r\n-------------\r\n\r\nThis package is fully compatible with Python 2+, Python 3+ and PyPy\r\n\r\n\r\nWhy?\r\n----\r\n\r\nI really enjoyed Ruby String interpolation, and ``\"\".format(...)`` or\r\n``\"\" % (...)`` seems very verbose to me. *I'm lazy by nature* ;)\r\n\r\n.. _pyxl template engine: https://github.com/dropbox/pyxl\r\n.. _PEP 263: http://www.python.org/dev/peps/pep-0263/", "description_content_type": null, "docs_url": null, "download_url": "git@github.com:syrusakbary/interpy.git", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/syrusakbary/interpy", "keywords": "python string interpolation interpolate ruby codec", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "interpy", "package_url": "https://pypi.org/project/interpy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/interpy/", "project_urls": { "Download": "git@github.com:syrusakbary/interpy.git", "Homepage": "http://github.com/syrusakbary/interpy" }, "release_url": "https://pypi.org/project/interpy/1.1/", "requires_dist": null, "requires_python": null, "summary": "Interpy extends Python to support Ruby like string interpolation #{}.", "version": "1.1" }, "last_serial": 963871, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "557a5313985fb7dea99790b739befd62", "sha256": "2bf539b0f3fdc449c79139dc9cb901992736819d2c3f4f854a718507107cb703" }, "downloads": -1, "filename": "interpy-1.0.tar.gz", "has_sig": false, "md5_digest": "557a5313985fb7dea99790b739befd62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3863, "upload_time": "2014-01-08T00:53:41", "url": "https://files.pythonhosted.org/packages/bc/7d/da011d70bdf1cfa6e9bbd4b3f22fd2eab96e51525b1b33c22b163d521765/interpy-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "a9bc94f902d2ac6bc03e224aa6f8275f", "sha256": "b758d973a01beb7629c0d911ba051e975a576aa8fe21645a17e6197e1cdee058" }, "downloads": -1, "filename": "interpy-1.1.tar.gz", "has_sig": false, "md5_digest": "a9bc94f902d2ac6bc03e224aa6f8275f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9733, "upload_time": "2014-01-08T21:46:27", "url": "https://files.pythonhosted.org/packages/3c/1d/9ed213a6beb6ae3dbf312da4f1f78531713f88c6a06504ec07844c08ecdf/interpy-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a9bc94f902d2ac6bc03e224aa6f8275f", "sha256": "b758d973a01beb7629c0d911ba051e975a576aa8fe21645a17e6197e1cdee058" }, "downloads": -1, "filename": "interpy-1.1.tar.gz", "has_sig": false, "md5_digest": "a9bc94f902d2ac6bc03e224aa6f8275f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9733, "upload_time": "2014-01-08T21:46:27", "url": "https://files.pythonhosted.org/packages/3c/1d/9ed213a6beb6ae3dbf312da4f1f78531713f88c6a06504ec07844c08ecdf/interpy-1.1.tar.gz" } ] }