{ "info": { "author": "un.def", "author_email": "me@undef.im", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "polypie\n=======\n\n|Build Status| |Coverage Status| |PyPI version| |PyPI license|\n\nPython polymorphic function declaration with obvious syntax. Just use\nthe same function name and mark each function definition with\n``@polymorphic`` decorator.\n\nInstallation\n~~~~~~~~~~~~\n\n``pip install polypie``\n\nRequirements\n~~~~~~~~~~~~\n\n- Python 3.5+\n- `typeguard `__ (will be installed automatically)\n\nExample\n~~~~~~~\n\n.. code:: python\n\n from typing import Any, Sequence\n\n from polypie import polymorphic, PolypieException\n\n\n @polymorphic\n def example(a: int, b):\n print('(1)')\n\n\n @polymorphic\n def example(a: str, b: Any):\n print('(2)')\n\n\n @polymorphic\n def example(a: Sequence[str]):\n print('(3)')\n\n\n example(100, 200) # (1)\n example('foo', 200) # (2)\n example(['foo']) # (3)\n example(('bar', 'baz')) # (3)\n try:\n example({'foo': 'bar'})\n except PolypieException as exc:\n print(exc) # Matching signature <...> not found\n\n\n class Example:\n\n def __init__(self):\n self.values = {}\n\n @polymorphic\n def value(self, name):\n return self.values[name]\n\n @polymorphic\n def value(self, name, value):\n self.values[name] = value\n\n\n instance = Example()\n instance.value('foo', 100)\n instance.value('bar', 'baz')\n print(instance.value('foo')) # 100\n print(instance.value('bar')) # baz\n\nTests\n~~~~~\n\n``tox [-e ENV] [-- --cov]``\n\n.. |Build Status| image:: https://travis-ci.org/un-def/polypie.svg?branch=master\n :target: https://travis-ci.org/un-def/polypie\n.. |Coverage Status| image:: https://coveralls.io/repos/github/un-def/polypie/badge.svg?branch=master\n :target: https://coveralls.io/github/un-def/polypie?branch=master\n.. |PyPI version| image:: https://badge.fury.io/py/polypie.svg\n :target: https://pypi.python.org/pypi/polypie/\n.. |PyPI license| image:: https://img.shields.io/pypi/l/polypie.svg?maxAge=3600\n :target: https://raw.githubusercontent.com/un-def/polypie/master/LICENSE\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/un-def/polypie", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "polypie", "package_url": "https://pypi.org/project/polypie/", "platform": "", "project_url": "https://pypi.org/project/polypie/", "project_urls": { "Homepage": "https://github.com/un-def/polypie" }, "release_url": "https://pypi.org/project/polypie/0.2.0/", "requires_dist": [ "typeguard" ], "requires_python": ">=3.5", "summary": "Python polymorphic function declaration with obvious syntax", "version": "0.2.0" }, "last_serial": 5296502, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "788ff2bda9c30c9cab591de5d21853c9", "sha256": "a7864561ab2357c42b5900badbb8f098bda23873d41090ac6e7fbf32b4b663d0" }, "downloads": -1, "filename": "polypie-0.1.0.tar.gz", "has_sig": false, "md5_digest": "788ff2bda9c30c9cab591de5d21853c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3239, "upload_time": "2016-06-10T11:44:21", "url": "https://files.pythonhosted.org/packages/bd/12/6d4c6c1ac793d8a737d0ee6c831f4c774575b210890183c8f35ced857545/polypie-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a3f2025ced7504f297836642c1fff7d7", "sha256": "6daf8c6dadf06da78e62d1be18f2d34bd22932d49aff67e3eecf9b75fd5b2a17" }, "downloads": -1, "filename": "polypie-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a3f2025ced7504f297836642c1fff7d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3307, "upload_time": "2016-06-10T12:01:45", "url": "https://files.pythonhosted.org/packages/23/89/7331a7fb01f3ee17cc044bd03934f79f05f7c1b4e26de569dd1dc989a5fe/polypie-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a20db75643e72da95ddf9b6567d2f596", "sha256": "7f7b2e95d3041203aca56c5ec14d12d3eb239cb0ff8df07f8190853d591bf11b" }, "downloads": -1, "filename": "polypie-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a20db75643e72da95ddf9b6567d2f596", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3500, "upload_time": "2016-06-10T15:14:53", "url": "https://files.pythonhosted.org/packages/a5/b0/01cddf61a8c8079a663fcbf91354d95773933ac3d5efa18c697b47208aa3/polypie-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "9111efebf885639c55df14fca54ab031", "sha256": "8676ad9195e32b4478f8b259ec8e04c1af2101d31fa990a40d078809333d9502" }, "downloads": -1, "filename": "polypie-0.1.3.tar.gz", "has_sig": false, "md5_digest": "9111efebf885639c55df14fca54ab031", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3871, "upload_time": "2016-06-16T11:35:34", "url": "https://files.pythonhosted.org/packages/60/80/fd79e93c006d5bdc09e65e8e1ee2205cd07b8d5d3cb1bd4687d4089a7f5e/polypie-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7fb7502f28719d0f61305e19c666c220", "sha256": "e8c584f2d60fe82586e08a9aed9e6c427b6d2b95538b4b441500b5ab3ba99508" }, "downloads": -1, "filename": "polypie-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7fb7502f28719d0f61305e19c666c220", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 3768, "upload_time": "2019-05-21T08:38:24", "url": "https://files.pythonhosted.org/packages/66/78/ca281335f50d4981646be33d671d6b83bc2095ea291d2e00f40053c49714/polypie-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60f8870460a7860f297d8f8497687419", "sha256": "07acea8578cdb4b533d724297b3d6739b0d146cc3b004b2b7efd387b9b83f2bd" }, "downloads": -1, "filename": "polypie-0.2.0.tar.gz", "has_sig": false, "md5_digest": "60f8870460a7860f297d8f8497687419", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 3740, "upload_time": "2019-05-21T08:38:25", "url": "https://files.pythonhosted.org/packages/75/5d/71d481fc92cbf87000060b84bd9de534a6f163609ac6ea72b8f783bb3023/polypie-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7fb7502f28719d0f61305e19c666c220", "sha256": "e8c584f2d60fe82586e08a9aed9e6c427b6d2b95538b4b441500b5ab3ba99508" }, "downloads": -1, "filename": "polypie-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7fb7502f28719d0f61305e19c666c220", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 3768, "upload_time": "2019-05-21T08:38:24", "url": "https://files.pythonhosted.org/packages/66/78/ca281335f50d4981646be33d671d6b83bc2095ea291d2e00f40053c49714/polypie-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60f8870460a7860f297d8f8497687419", "sha256": "07acea8578cdb4b533d724297b3d6739b0d146cc3b004b2b7efd387b9b83f2bd" }, "downloads": -1, "filename": "polypie-0.2.0.tar.gz", "has_sig": false, "md5_digest": "60f8870460a7860f297d8f8497687419", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 3740, "upload_time": "2019-05-21T08:38:25", "url": "https://files.pythonhosted.org/packages/75/5d/71d481fc92cbf87000060b84bd9de534a6f163609ac6ea72b8f783bb3023/polypie-0.2.0.tar.gz" } ] }