{ "info": { "author": "Paul Baecher", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# datadispatch\n\ndatadispatch provides a dispatch mechanism (a.k.a. polymorphism) like `functools.singledispatch`, but it operates on data instead of types. This is useful if you are creating simple data-centric applications where you want polymorphism \u00e0 la carte without resorting to types or classes.\n\ndatadispatch is available through pip: `pip install datadispatch`\n\n## Usage example\n\n```python\nfrom datadispatch import datadispatch\n\n@datadispatch(lambda args, _: args[0].get('type'))\ndef handle(message):\n raise ValueError('cannot handle message: {}'.format(message))\n\n\n@handle.register('ping')\ndef _(message):\n return 'you sent ping'\n\n\n@handle.register('pong')\ndef _(message):\n return 'you sent pong'\n\n\nprint(handle(\n {'type': 'ping', 'payload': 'hello'}\n))\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pb-/datadispatch", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "datadispatch", "package_url": "https://pypi.org/project/datadispatch/", "platform": "", "project_url": "https://pypi.org/project/datadispatch/", "project_urls": { "Homepage": "https://github.com/pb-/datadispatch" }, "release_url": "https://pypi.org/project/datadispatch/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Like functools.singledispatch but for values", "version": "1.0.0" }, "last_serial": 4633773, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "14ae19926efbe23dc168cde811616583", "sha256": "527ad534881d7f6144a8ff643c260a3d2ae0d50e8ee24ec4b0fdae72d6c7beab" }, "downloads": -1, "filename": "datadispatch-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "14ae19926efbe23dc168cde811616583", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2632, "upload_time": "2018-12-25T16:33:53", "url": "https://files.pythonhosted.org/packages/80/6a/d38daeb232e560803057c202ada249c5f53a7d532eae216660af42a23781/datadispatch-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d879a864c989e0b624bda156761a67b6", "sha256": "3c0456934e99f21137332deebbda05713dc07fcb142dfc01ef83d6b17aeaf08e" }, "downloads": -1, "filename": "datadispatch-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d879a864c989e0b624bda156761a67b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1800, "upload_time": "2018-12-25T16:33:55", "url": "https://files.pythonhosted.org/packages/af/c9/2a1d98bf6a1e2ca41465dd77dc025d8a13b713c6d4378227c8938258c5d4/datadispatch-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "14ae19926efbe23dc168cde811616583", "sha256": "527ad534881d7f6144a8ff643c260a3d2ae0d50e8ee24ec4b0fdae72d6c7beab" }, "downloads": -1, "filename": "datadispatch-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "14ae19926efbe23dc168cde811616583", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2632, "upload_time": "2018-12-25T16:33:53", "url": "https://files.pythonhosted.org/packages/80/6a/d38daeb232e560803057c202ada249c5f53a7d532eae216660af42a23781/datadispatch-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d879a864c989e0b624bda156761a67b6", "sha256": "3c0456934e99f21137332deebbda05713dc07fcb142dfc01ef83d6b17aeaf08e" }, "downloads": -1, "filename": "datadispatch-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d879a864c989e0b624bda156761a67b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1800, "upload_time": "2018-12-25T16:33:55", "url": "https://files.pythonhosted.org/packages/af/c9/2a1d98bf6a1e2ca41465dd77dc025d8a13b713c6d4378227c8938258c5d4/datadispatch-1.0.0.tar.gz" } ] }