# doCheck
## Introduction
`doCheck` is an open-source type checking module written in Python, released under the Mulan Permissive Software License v2 (MulanPSL-2.0). This module provides a set of reusable Checker classes for validating properties and conditions of different types of values.
## Installation
```bash
pip install doCheck
```
## Features
- Provides various logical operator overload methods such as intersection, union, complement, negation, etc., for composing complex data validation rules.
- Includes `LiteralChecker` (also known as `EnumChecker`) to check if a value is in a predefined list.
- `TypeChecker` is used to validate if a value belongs to a specific collection of data types.
- `RangeChecker` supports conditional checks within a numeric range and allows customization of interval closure.
- Additionally, `CallableChecker` and `RegexChecker` are provided to check if a value is a callable object and if a string matches a regular expression, respectively.
## Usage Example
```python
import doCheck as dc
# Create checker instances
is_integer = dc.TypeChecker(int)
is_even = dc.RangeChecker(0, float('inf'), leftClosed=True, step=2)
is_valid_name = dc.RegexChecker(r'^[A-Za-z]+\s[A-Za-z]+$')
# Apply checkers
print(is_integer.check(42)) # Output: True
print(is_even.check(10)) # Output: True
print(is_valid_name.check("John Doe")) # Output: True
```
## License
doCheck module is licensed under the Mulan Permissive Software License v2.0. For more information about this license, please visit: [https://opensource.org/license/mulanpsl-2-0/](https://opensource.org/license/mulanpsl-2-0/)
| [![Github](https://img.shields.io/badge/GitHub-black?logo=github)](https://github.com/kuankuan2007/do-check) | [![gitee](https://img.shields.io/badge/Gitee-rgb(199%2C29%2C35)?logo=gitee)](https://gitee.com/kuankuan2007/do-check) | [![Static Badge](https://img.shields.io/badge/Gitab-rgb(226%2C67%2C41)?logo=gitlab)](https://gitlab.com/kuankuan2007/do-check) |
Note: To use this module, make sure to import it correctly and comply with the relevant open-source license terms.
Raw data
{
"_id": null,
"home_page": "https://kuankuan2007.gitee.io/do-check-pages/",
"name": "doCheck",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "type,check,value,constraint",
"author": "kuankuan",
"author_email": "2163826131@qq.com",
"download_url": "https://files.pythonhosted.org/packages/2e/de/5d508e4fb0f170c63c13970e6b56172dad9f3d5a5eba8c6595aa339d856a/doCheck-0.1.3.tar.gz",
"platform": "windows",
"description": "# doCheck\r\n\r\n## Introduction\r\n\r\n`doCheck` is an open-source type checking module written in Python, released under the Mulan Permissive Software License v2 (MulanPSL-2.0). This module provides a set of reusable Checker classes for validating properties and conditions of different types of values.\r\n\r\n## Installation\r\n\r\n```bash\r\npip install doCheck\r\n```\r\n\r\n## Features\r\n\r\n- Provides various logical operator overload methods such as intersection, union, complement, negation, etc., for composing complex data validation rules.\r\n- Includes `LiteralChecker` (also known as `EnumChecker`) to check if a value is in a predefined list.\r\n- `TypeChecker` is used to validate if a value belongs to a specific collection of data types.\r\n- `RangeChecker` supports conditional checks within a numeric range and allows customization of interval closure.\r\n- Additionally, `CallableChecker` and `RegexChecker` are provided to check if a value is a callable object and if a string matches a regular expression, respectively.\r\n\r\n## Usage Example\r\n\r\n```python\r\nimport doCheck as dc\r\n\r\n# Create checker instances\r\nis_integer = dc.TypeChecker(int)\r\nis_even = dc.RangeChecker(0, float('inf'), leftClosed=True, step=2)\r\nis_valid_name = dc.RegexChecker(r'^[A-Za-z]+\\s[A-Za-z]+$')\r\n\r\n# Apply checkers\r\nprint(is_integer.check(42)) # Output: True\r\nprint(is_even.check(10)) # Output: True\r\nprint(is_valid_name.check(\"John Doe\")) # Output: True\r\n```\r\n\r\n## License\r\n\r\ndoCheck module is licensed under the Mulan Permissive Software License v2.0. For more information about this license, please visit: [https://opensource.org/license/mulanpsl-2-0/](https://opensource.org/license/mulanpsl-2-0/)\r\n\r\n| [![Github](https://img.shields.io/badge/GitHub-black?logo=github)](https://github.com/kuankuan2007/do-check) | [![gitee](https://img.shields.io/badge/Gitee-rgb(199%2C29%2C35)?logo=gitee)](https://gitee.com/kuankuan2007/do-check) | [![Static Badge](https://img.shields.io/badge/Gitab-rgb(226%2C67%2C41)?logo=gitlab)](https://gitlab.com/kuankuan2007/do-check) |\r\n\r\nNote: To use this module, make sure to import it correctly and comply with the relevant open-source license terms.\r\n",
"bugtrack_url": null,
"license": "Mulan PSL v2",
"summary": "Check the value both type and value and then constraint it.",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://kuankuan2007.gitee.io/do-check-pages/"
},
"split_keywords": [
"type",
"check",
"value",
"constraint"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c4ea184860f181d9ec409b182adcd91efab2840fcbb0c1d09c68093fef8ed30e",
"md5": "5ffd87992140d63dd94353e30b49bd3c",
"sha256": "6ba3cb69f25b50dfd3c7b84a47758915da97ee3e9f0ca6ad301846f37b82165d"
},
"downloads": -1,
"filename": "doCheck-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5ffd87992140d63dd94353e30b49bd3c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 8158,
"upload_time": "2024-02-12T03:51:23",
"upload_time_iso_8601": "2024-02-12T03:51:23.413392Z",
"url": "https://files.pythonhosted.org/packages/c4/ea/184860f181d9ec409b182adcd91efab2840fcbb0c1d09c68093fef8ed30e/doCheck-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2ede5d508e4fb0f170c63c13970e6b56172dad9f3d5a5eba8c6595aa339d856a",
"md5": "e7b473c40b0931c92930c99df9754464",
"sha256": "8b971a25a0059836c11b211720107ad50a356d6b10e993935e8868b7b248a4ea"
},
"downloads": -1,
"filename": "doCheck-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "e7b473c40b0931c92930c99df9754464",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8153,
"upload_time": "2024-02-12T03:51:25",
"upload_time_iso_8601": "2024-02-12T03:51:25.375149Z",
"url": "https://files.pythonhosted.org/packages/2e/de/5d508e4fb0f170c63c13970e6b56172dad9f3d5a5eba8c6595aa339d856a/doCheck-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-12 03:51:25",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "docheck"
}