{ "info": { "author": "Joseph Perez", "author_email": "joperez@hotmail.fr", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# TMV (Type Model Visitor)\n\nVisitor for type models using typing annotations.\n\n## What's inside?\n\nThe package contains an *abstract* `Visitor` class which needs by-type methods implementation. Only (some of) the standard types are supported:\n- primitives (`int`, `str`, `float`, `bool`)\n- iterables\n- mappings\n- tuples\n- dataclasses\n- `Enum`, `Any`, `Tuple`, `Union`, `Optional`, `Literal`, `NewType`\n- *soon* `TypedDict` (PEP 589), `Annotated` (PEP 593), etc.\n\nUnsupported types are handled in `unsupported` method, of which default implementation raises `Unsupported` exception.\n\n`Visitor` offers support for custom types through 2 methods `\u00ecs_custom` and `custom`. The return value of `is_custom` is passed to `custom` when evaluated to `True`; it's thus convenient to use an optional return type. Customs types are handled before others classes like dataclasses or enumerations (to enable custom handling for them).\n\nSee [apischema](https://github.com/wyfo/apischema/) for concrete use of the package\n\n## Comments\n- If an abstract class was at first considered for `Visitor` implementation, raising `NotImplementedError` has been chosen because it enable an easier use, especially in case of partial implementation (which would imply to overwrite with `NotImplementedError` in case of `ABC` inheritance)\n- For convenience, inheritance is not handled in this project. In fact, if `__bases__` and even `__orig_bases__` could be used, this would raises other issues like multiple inheritance. Moreover, some implementation could rely on `__init__` method (it's the case *apischema* from which this project was originally extracted), and inheritance makes things fuzzy on this point.\n- Customs type could be handled in an overwrite of `unsupported` method, but this would make impossible to handle *custom* dataclasses, that's why a dedicated method is used\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/wyfo/tmv", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "tmv", "package_url": "https://pypi.org/project/tmv/", "platform": "", "project_url": "https://pypi.org/project/tmv/", "project_urls": { "Homepage": "https://github.com/wyfo/tmv" }, "release_url": "https://pypi.org/project/tmv/0.1.3/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Type Model Visitor", "version": "0.1.3" }, "last_serial": 5673783, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "f40e680c7d0e54bfbb6b2a5e66f35e03", "sha256": "a8865720e153d27cb50ceb2ddfa93991ca8e90fc0bfd03cfd959256cc922ca82" }, "downloads": -1, "filename": "tmv-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f40e680c7d0e54bfbb6b2a5e66f35e03", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4445, "upload_time": "2019-08-13T18:59:36", "url": "https://files.pythonhosted.org/packages/7a/5f/e5b7d2ead0d5ed2776db8df53fa47698bb6feaf247694f6f5361bd1389f6/tmv-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "af812820cc7bc5bff49513aff3497969", "sha256": "8711ccc61695f5486a7166897ec29c1f3b71b0e19d3e61c7344d4cc28431964b" }, "downloads": -1, "filename": "tmv-0.1.1.tar.gz", "has_sig": false, "md5_digest": "af812820cc7bc5bff49513aff3497969", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3628, "upload_time": "2019-08-13T18:59:38", "url": "https://files.pythonhosted.org/packages/67/58/a1a34a7425fd9859b5328003c0b76eea1d32d3d724191a7be43c383a04a1/tmv-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c62829109c6a7bda403be5f3c79aec01", "sha256": "27b0ca0f6a192dea55c3bc0abd850bf31454fe3c648d186b70b28d282843a5de" }, "downloads": -1, "filename": "tmv-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c62829109c6a7bda403be5f3c79aec01", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4459, "upload_time": "2019-08-13T19:24:13", "url": "https://files.pythonhosted.org/packages/b5/c7/8f58add2f09690deafe4e48e1b4c0923490a3fd28b3895db91351f4d168c/tmv-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43f5d6197e925d7ad46c72c18bdb647f", "sha256": "71a3c854df83146a14a5a8b9cd9b4462dda97b434bdcb77537ba4d5bed39d857" }, "downloads": -1, "filename": "tmv-0.1.2.tar.gz", "has_sig": false, "md5_digest": "43f5d6197e925d7ad46c72c18bdb647f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3631, "upload_time": "2019-08-13T19:24:16", "url": "https://files.pythonhosted.org/packages/35/b2/1194c61e61eb34d306338ac2d0ba667b019239cea9f356072de799107a23/tmv-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "afce47b536f69f3b45a7b6b656dcf3a7", "sha256": "7a586698dbc8370903af5776e2b3b908cc2f7cafc2da1543634458535f3a71b3" }, "downloads": -1, "filename": "tmv-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "afce47b536f69f3b45a7b6b656dcf3a7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4453, "upload_time": "2019-08-13T21:38:57", "url": "https://files.pythonhosted.org/packages/da/65/4148a43fa9c34a74e3ad2086faf4565f0981a2dc492b46fb1612a04373a2/tmv-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "edd6999cd1b20c58678d0a8fb1d33e1d", "sha256": "0db93c6cd65b75d7608576187bbdecd97f48519977d254a43a58392c5c02b129" }, "downloads": -1, "filename": "tmv-0.1.3.tar.gz", "has_sig": false, "md5_digest": "edd6999cd1b20c58678d0a8fb1d33e1d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3623, "upload_time": "2019-08-13T21:39:01", "url": "https://files.pythonhosted.org/packages/a0/90/93e487a95cb4879d9bcdfdbbfc7ccdf629b5801eb697d289a57508d1c0a1/tmv-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "afce47b536f69f3b45a7b6b656dcf3a7", "sha256": "7a586698dbc8370903af5776e2b3b908cc2f7cafc2da1543634458535f3a71b3" }, "downloads": -1, "filename": "tmv-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "afce47b536f69f3b45a7b6b656dcf3a7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4453, "upload_time": "2019-08-13T21:38:57", "url": "https://files.pythonhosted.org/packages/da/65/4148a43fa9c34a74e3ad2086faf4565f0981a2dc492b46fb1612a04373a2/tmv-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "edd6999cd1b20c58678d0a8fb1d33e1d", "sha256": "0db93c6cd65b75d7608576187bbdecd97f48519977d254a43a58392c5c02b129" }, "downloads": -1, "filename": "tmv-0.1.3.tar.gz", "has_sig": false, "md5_digest": "edd6999cd1b20c58678d0a8fb1d33e1d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3623, "upload_time": "2019-08-13T21:39:01", "url": "https://files.pythonhosted.org/packages/a0/90/93e487a95cb4879d9bcdfdbbfc7ccdf629b5801eb697d289a57508d1c0a1/tmv-0.1.3.tar.gz" } ] }