Name | vali-helper JSON |
Version |
1.1.0
JSON |
| download |
home_page | |
Summary | vali-helper is a util to help define the value checker on a function. |
upload_time | 2024-03-06 14:54:41 |
maintainer | |
docs_url | None |
author | |
requires_python | |
license | MIT License Copyright (c) 2023 babybabyCloud 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 |
validation
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# vali-helper
#### Description
valid-helper is a util that helps define the validation to the parameters of functions
#### Installation
```bash
pip install vali_helper
```
#### Instructions
This package is very easy to use. There are some pre-defined validation classes. For example, if a function give_money
has an int parameter money, and it requires the parameter is greater than "0", it can be written in the below following
form:
```python
from vali import *
@validator(valis=[GreaterThan(name='money', value=0)])
def give_money(money: int | float):
print(money)
>>> give_money(-10)
Traceback (most recent call last):
vali.validation.ValiFailError: The validation value must greater than 0, but provided -10
```
More examples could be referred to src/vali/tests
Raw data
{
"_id": null,
"home_page": "",
"name": "vali-helper",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "validation",
"author": "",
"author_email": "babybabycloud <babybabycloud2020@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d4/75/5f18e37e6949ac4ab94fbaf63853786c7908464e78f0526774c7a51db289/vali_helper-1.1.0.tar.gz",
"platform": null,
"description": "# vali-helper\n\n#### Description\nvalid-helper is a util that helps define the validation to the parameters of functions\n\n#### Installation\n```bash\npip install vali_helper\n```\n\n#### Instructions\nThis package is very easy to use. There are some pre-defined validation classes. For example, if a function give_money\nhas an int parameter money, and it requires the parameter is greater than \"0\", it can be written in the below following\nform:\n```python\nfrom vali import *\n\n\n@validator(valis=[GreaterThan(name='money', value=0)])\ndef give_money(money: int | float):\n print(money)\n\n>>> give_money(-10)\nTraceback (most recent call last):\n\nvali.validation.ValiFailError: The validation value must greater than 0, but provided -10\n```\nMore examples could be referred to src/vali/tests\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 babybabyCloud 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. ",
"summary": "vali-helper is a util to help define the value checker on a function.",
"version": "1.1.0",
"project_urls": {
"homepage": "https://github.com/babybabycloud/vali-helper"
},
"split_keywords": [
"validation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eb71c7730739e6522e9e616541f5cdeda57096eab06a05d51f9af8341041f25c",
"md5": "6bfbd0683ecd0ec05914de1dcde5ff95",
"sha256": "368e4e9e52926869d759925458a5948737badb0474472236539c3a829c03e365"
},
"downloads": -1,
"filename": "vali_helper-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6bfbd0683ecd0ec05914de1dcde5ff95",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9060,
"upload_time": "2024-03-06T14:54:40",
"upload_time_iso_8601": "2024-03-06T14:54:40.128674Z",
"url": "https://files.pythonhosted.org/packages/eb/71/c7730739e6522e9e616541f5cdeda57096eab06a05d51f9af8341041f25c/vali_helper-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d4755f18e37e6949ac4ab94fbaf63853786c7908464e78f0526774c7a51db289",
"md5": "3f6f841041104801d236c7b2a1fc357a",
"sha256": "aa845259cae4901750c59f3c4f43cbd82cf81cf0abaf366c17818450db8f57e8"
},
"downloads": -1,
"filename": "vali_helper-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3f6f841041104801d236c7b2a1fc357a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10200,
"upload_time": "2024-03-06T14:54:41",
"upload_time_iso_8601": "2024-03-06T14:54:41.068412Z",
"url": "https://files.pythonhosted.org/packages/d4/75/5f18e37e6949ac4ab94fbaf63853786c7908464e78f0526774c7a51db289/vali_helper-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-06 14:54:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "babybabycloud",
"github_project": "vali-helper",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"tox": true,
"lcname": "vali-helper"
}