Name | TypeEnforcer JSON |
Version |
1.5.0
JSON |
| download |
home_page | |
Summary | enforce python type hints |
upload_time | 2023-03-25 03:25:57 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.9 |
license | Copyright 2023 Michael Ray Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
types
typing
static typing
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Type Enforcer
add as a decorator to any python function to enforce type hints, turning python functions from dynamically to statically typed in the runtime.
Enforces python type hints.
Parameters and returns that do not have explicit hints will be assumed to have types of typing.Any
Supports basic type hinting operations, like Type[], Union[], and GenericAlias objects like dict[] and list[]
Supports recursive type checking in runtime! If you want to check that the contents in a deep nested datastructure match type hints,
just enable recursive type checking with "recursive=True". Note that this significantly increases the computation necessary to run functions
so it is advisable to only run this during the debugging phase of development. Note that as of now this only works with lists, tuples, sets, and dicts
Overall, best used with debugging
## Install
1. pip install TypeEnforcer
2. from TypeEnforcer.TypeEnforcement.type_enforcer import TypeEnforcer
3. @TypeEnforcer.enforcer
Raw data
{
"_id": null,
"home_page": "",
"name": "TypeEnforcer",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "types,typing,static typing",
"author": "",
"author_email": "Michael Ray <m.ray37990@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/cc/0b/1f2d8eac4683419d8ab89f0ebe0d105ec1b9f0b271dcee214bd08a703886/TypeEnforcer-1.5.0.tar.gz",
"platform": null,
"description": "# Type Enforcer\r\nadd as a decorator to any python function to enforce type hints, turning python functions from dynamically to statically typed in the runtime.\r\n\r\nEnforces python type hints. \r\nParameters and returns that do not have explicit hints will be assumed to have types of typing.Any\r\nSupports basic type hinting operations, like Type[], Union[], and GenericAlias objects like dict[] and list[]\r\n\r\nSupports recursive type checking in runtime! If you want to check that the contents in a deep nested datastructure match type hints,\r\njust enable recursive type checking with \"recursive=True\". Note that this significantly increases the computation necessary to run functions\r\nso it is advisable to only run this during the debugging phase of development. Note that as of now this only works with lists, tuples, sets, and dicts\r\n\r\nOverall, best used with debugging\r\n\r\n## Install\r\n1. pip install TypeEnforcer\r\n2. from TypeEnforcer.TypeEnforcement.type_enforcer import TypeEnforcer\r\n3. @TypeEnforcer.enforcer\r\n",
"bugtrack_url": null,
"license": "Copyright 2023 Michael Ray Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "enforce python type hints",
"version": "1.5.0",
"split_keywords": [
"types",
"typing",
"static typing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ddcbabb048cddbfb27cc775a01256c60b9016b34784b879f8f6c06e5e8d368d1",
"md5": "5df6b4011ae24247ed9a8936d79043bc",
"sha256": "8fe7d379f2eca81556f2f18ca9c6efea7a0732976e25f9c11b0d9d76510ba920"
},
"downloads": -1,
"filename": "TypeEnforcer-1.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5df6b4011ae24247ed9a8936d79043bc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6554,
"upload_time": "2023-03-25T03:25:55",
"upload_time_iso_8601": "2023-03-25T03:25:55.898421Z",
"url": "https://files.pythonhosted.org/packages/dd/cb/abb048cddbfb27cc775a01256c60b9016b34784b879f8f6c06e5e8d368d1/TypeEnforcer-1.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc0b1f2d8eac4683419d8ab89f0ebe0d105ec1b9f0b271dcee214bd08a703886",
"md5": "62c20f9b07992c20b4c2e2e791a4b9cf",
"sha256": "aeaa24dee13982345945411a9fa1e8a66a2e0d218cf4e8fb9ebc4e544bfa3cdf"
},
"downloads": -1,
"filename": "TypeEnforcer-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "62c20f9b07992c20b4c2e2e791a4b9cf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 5107,
"upload_time": "2023-03-25T03:25:57",
"upload_time_iso_8601": "2023-03-25T03:25:57.003638Z",
"url": "https://files.pythonhosted.org/packages/cc/0b/1f2d8eac4683419d8ab89f0ebe0d105ec1b9f0b271dcee214bd08a703886/TypeEnforcer-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-25 03:25:57",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "typeenforcer"
}