{ "info": { "author": "Nicholas Tancredi", "author_email": "nicholastancredi@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# TypedClass\nA python class made for extended other classes giving them type checking on annotated attributes and other nice things like required attributes, immutable attributes, validation functions for attributes, choices for attributes.\n\n# Example Usage\n## TypedClass\n```python\nfrom TypedClass import TypedClass, TypeDef\n\nclass ExampleTypedClass(TypedClass):\n simple: int\n\n using_type_def: TypeDef(typeof=int)\n\n simple_with_default: float = 1.01\n\n type_hint_with_default: TypeDef(\n typeof=int\n ) = 22\n\n all_options: TypeDef(\n typeof=int,\n required=True,\n immutable=True,\n choices=[21, 22, 23],\n validate_fn=lambda x: x > 20\n ) = 23\n\n def __init__(\n self,\n simple: int,\n using_type_def: int,\n simple_with_default: float = 1.01,\n type_hint_with_default: int = 22,\n all_options: int = 23,\n ):\n super().__init__(\n simple=simple,\n using_type_def=using_type_def,\n simple_with_default=simple_with_default,\n type_hint_with_default=type_hint_with_default,\n all_options=all_options\n )\n\n```\n\n## TypedClassStrict\nSame as above, only everything is set to required and immutable by default.\n\n## TypedClassJson\n```python\nfrom TypedClass import TypedClassJson\n\nclass ExampleJSONValidationUsageObj(TypedClassJson):\n name: str\n value: str\n valid: bool\n\nclass ExampleJSONValidationUsageWithHelperClass(TypedClassJson):\n _id: int\n sender: str\n kind: str\n nested_obj: ExampleJSONValidationUsageObj\n nested_obj_with_help: ExampleJSONValidationUsageObj\n\n\nexample_json = {\n '_id': 1,\n 'sender': 'nic',\n 'kind': 'message',\n 'nested_obj': {\n 'name': 'nested_obj',\n 'value': 'cool',\n 'valid': True\n },\n 'nested_obj_with_help': {\n 'name': 'nested_obj_with_help',\n 'value': 'very cool',\n 'valid': True\n }\n}\n\n# ...\n\nimport unittest\n\njson_output_example = ExampleJSONValidationUsageWithHelperClass(example_json)\n\ntc = unittest.TestCase('__init__')\n\ntc.assertEqual(example_json, json_output_example.dict)\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/w0251251/TypedClass", "keywords": "", "license": "GNU", "maintainer": "", "maintainer_email": "", "name": "TypedClass", "package_url": "https://pypi.org/project/TypedClass/", "platform": "", "project_url": "https://pypi.org/project/TypedClass/", "project_urls": { "Homepage": "https://github.com/w0251251/TypedClass" }, "release_url": "https://pypi.org/project/TypedClass/0.0.5/", "requires_dist": null, "requires_python": "", "summary": "Extend other classes to give them type checking via annotations", "version": "0.0.5" }, "last_serial": 4466882, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "93f8fb9240f9c65e9cd7f002b48e6095", "sha256": "d89ab80a2f3bc91ac1890ae535a19b1df6bfce93181db87cab355dd5d139d429" }, "downloads": -1, "filename": "TypedClass-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "93f8fb9240f9c65e9cd7f002b48e6095", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13655, "upload_time": "2018-11-04T17:15:51", "url": "https://files.pythonhosted.org/packages/af/33/51a1b7f39f4c02de2bae1e5c24e007e65f51dd2aa2bfe2673b46e47ecb2e/TypedClass-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d75421da3c2c2e106bea0e671690b7fe", "sha256": "f13665065c88fa57becae6bf1ee3dcf4ee7766552e22ee0c71a3432d4abcdd77" }, "downloads": -1, "filename": "TypedClass-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d75421da3c2c2e106bea0e671690b7fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 982, "upload_time": "2018-11-04T17:15:52", "url": "https://files.pythonhosted.org/packages/0e/a3/4f9b53ff3a72fe0d8faad113d501ef95f9123984d68e49cd4ccae2bea8ab/TypedClass-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "16beb6839817b94f41b73fa343bf56b5", "sha256": "74374dda31fdecf5a717a3a69ecb97b2821bc4117bc67fc55f70375583977e8b" }, "downloads": -1, "filename": "TypedClass-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "16beb6839817b94f41b73fa343bf56b5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16769, "upload_time": "2018-11-08T16:55:08", "url": "https://files.pythonhosted.org/packages/04/e7/6552fa8eedaa951fcd389138fba697a5c9b7bb2ee517123b2eea0b838ce2/TypedClass-0.0.2-py3-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "0c7460d8e2d30e1fadaa4cfa5eb5a303", "sha256": "63a8c6b1660fa60d5e923f35547d24207a4e7045ca7dcdf35a556a4cd211ec3e" }, "downloads": -1, "filename": "TypedClass-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0c7460d8e2d30e1fadaa4cfa5eb5a303", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17659, "upload_time": "2018-11-08T18:21:39", "url": "https://files.pythonhosted.org/packages/d1/b5/1cc8a7a6c70144b549c994efe55e54a7deb09c1fa9da6c1068c2186e8a2d/TypedClass-0.0.3-py3-none-any.whl" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "a218ff1cf2e8d7914acad117dc337cd1", "sha256": "d45763fd507356e74e85b988e4558958d6be409cd789431e978a7f65f9476942" }, "downloads": -1, "filename": "TypedClass-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "a218ff1cf2e8d7914acad117dc337cd1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17665, "upload_time": "2018-11-08T19:35:04", "url": "https://files.pythonhosted.org/packages/f8/04/114d914e8038a7d463d3ad66350a923af90335eacec2cc386ee6e4a76562/TypedClass-0.0.4-py3-none-any.whl" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "16b8572a9cc2bb260aca9858e77f27ae", "sha256": "c1ce6a97d86b5adf1f9a7a291f67464b0f173829989e27e905cb28e4d044442a" }, "downloads": -1, "filename": "TypedClass-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "16b8572a9cc2bb260aca9858e77f27ae", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18259, "upload_time": "2018-11-08T19:57:58", "url": "https://files.pythonhosted.org/packages/df/6a/af4b7d39d6def458721749fa99cc2187f96e349934b2d8a09044f495893a/TypedClass-0.0.5-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "16b8572a9cc2bb260aca9858e77f27ae", "sha256": "c1ce6a97d86b5adf1f9a7a291f67464b0f173829989e27e905cb28e4d044442a" }, "downloads": -1, "filename": "TypedClass-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "16b8572a9cc2bb260aca9858e77f27ae", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18259, "upload_time": "2018-11-08T19:57:58", "url": "https://files.pythonhosted.org/packages/df/6a/af4b7d39d6def458721749fa99cc2187f96e349934b2d8a09044f495893a/TypedClass-0.0.5-py3-none-any.whl" } ] }