{ "info": { "author": "Leonid Soputnyak", "author_email": "leonid.soputnyak@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries" ], "description": "Library for Role based development.\n\nThe big difference with mixins is that this role is applied only to the subject instance, not to the subject class (alas, a new class is constructed).\n\nRoles can be assigned and revoked. Multiple roles can be applied to an instance. Revocation can happen in any particular order.\n\nUsing Roles\nAs a basic example, consider a domain class:\n\n>>> class Person:\n... def __init__(self, name):\n... self.name = name\n>>> person = Person(\"John\")\nThe instance should participate in a collaboration in which it fulfills a particular role:\n\n>>> from roles import RoleType\n>>> class Carpenter(metaclass=RoleType):\n... def chop(self):\n... return \"chop, chop\"\nAssign the role to the person:\n\n>>> Carpenter(person) # doctest: +ELLIPSIS\n\n>>> person # doctest: +ELLIPSIS\n\nThe person is still a Person:\n\n>>> isinstance(person, Person)\nTrue\n\u2026 and can do carpenter things:\n\n>>> person.chop()\n'chop, chop'\nContext\nRoles make a lot of sense when used in a context. A classic example is the money transfer example. Here two accounts are used and an amount of money is transfered from one account to the other. So, one account playes the role of source account and the other plays the role of target account.\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "role DCI data context interaction", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "py-roles", "package_url": "https://pypi.org/project/py-roles/", "platform": "All", "project_url": "https://pypi.org/project/py-roles/", "project_urls": null, "release_url": "https://pypi.org/project/py-roles/0.1/", "requires_dist": null, "requires_python": "", "summary": "Role based development", "version": "0.1" }, "last_serial": 4805636, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2e2a3ea78514fcf426e4f722e9d920e5", "sha256": "6bd58983e77444e6c62e46f6bfdea684dab263b2dd41f82f7305c174dc92b1a1" }, "downloads": -1, "filename": "py_roles-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2e2a3ea78514fcf426e4f722e9d920e5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8890, "upload_time": "2019-02-11T11:59:19", "url": "https://files.pythonhosted.org/packages/cf/f3/e1c0fb96d9111837fe10e015c65002a8495f8a4bafac4862c433f8ff155a/py_roles-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dac1dfc5e587a7b531a6b28a31932b49", "sha256": "b670e83199e02e47e8fd634fd131b422a77562697f9376b7740ffb8d3e20ae25" }, "downloads": -1, "filename": "py_roles-0.1.tar.gz", "has_sig": false, "md5_digest": "dac1dfc5e587a7b531a6b28a31932b49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13821, "upload_time": "2019-02-11T11:59:21", "url": "https://files.pythonhosted.org/packages/21/8e/f24bbe6446011c19407bd39ab29cd37cdfec773c92cd15b34f321392a378/py_roles-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e2a3ea78514fcf426e4f722e9d920e5", "sha256": "6bd58983e77444e6c62e46f6bfdea684dab263b2dd41f82f7305c174dc92b1a1" }, "downloads": -1, "filename": "py_roles-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2e2a3ea78514fcf426e4f722e9d920e5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8890, "upload_time": "2019-02-11T11:59:19", "url": "https://files.pythonhosted.org/packages/cf/f3/e1c0fb96d9111837fe10e015c65002a8495f8a4bafac4862c433f8ff155a/py_roles-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dac1dfc5e587a7b531a6b28a31932b49", "sha256": "b670e83199e02e47e8fd634fd131b422a77562697f9376b7740ffb8d3e20ae25" }, "downloads": -1, "filename": "py_roles-0.1.tar.gz", "has_sig": false, "md5_digest": "dac1dfc5e587a7b531a6b28a31932b49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13821, "upload_time": "2019-02-11T11:59:21", "url": "https://files.pythonhosted.org/packages/21/8e/f24bbe6446011c19407bd39ab29cd37cdfec773c92cd15b34f321392a378/py_roles-0.1.tar.gz" } ] }