Name | decoguard JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | Lightweight Python library for robustly validating decorated functions, providing a clean, structured way to ensure they comply with defined conditions. |
upload_time | 2025-08-07 07:54:41 |
maintainer | None |
docs_url | None |
author | Shacode |
requires_python | >=3.13 |
license | None |
keywords |
decorators
validation
meta-decorator
introspection
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="center">
<img src="https://gitlab.com/Shacode/decoguard/-/raw/main/docs/logo.png" alt="decoguard logo" width="250">
</div>
# 🛡️ DECOGUARD
[](https://gitlab.com/Shacode/decoguard/-/releases)
[](https://gitlab.com/Shacode/decoguard/-/pipelines)
[](https://gitlab.com/Shacode/decoguard/-/jobs)
[](https://decoguard.readthedocs.io/en/latest/)
[](https://www.gnu.org/licenses/agpl-3.0)
[](https://www.python.org/)
[](https://gitlab.com/Shacode/decoguard)
Lightweight Python library for robustly validating decorated functions, providing a clean, structured way to ensure they comply with defined conditions.
[📚 The complete documentation is available here.](https://decoguard.readthedocs.io/en/latest/)
## ✨ Features
- **Meta-Decorators**: Easily add validation logic to your decorators and decorator factories.
- **Validator Functions**: Fine-grained validation rules for function signatures and usage.
- **Assertion Utilities**: Reusable assertion helpers for standalone validation.
- **Centralized Validation**: Keep your validation logic clean and maintainable.
- **Clear Error Reporting**: Developer-friendly exceptions for invalid decorator usage.
- **Drop-In Simplicity**: Integrate with existing Python code with minimal changes.
## 🚀 Getting Started
1. **Install decoguard**
```bash
pip install decoguard
```
2. **Import and use meta-decorators**
```python
from decoguard.decorators import validate_decorated
from decoguard.validators import require_params
@validate_decorated(require_params("x", "y"))
def my_decorator(func): return func
@my_decorator
def correct_usage(x, y): pass
@my_decorator
def bad_usage(x): pass # Will raise DecoratorUsageValidationError
```
## 💚 CI/CD Pipeline
This project maintains high code quality through automated GitLab CI/CD pipelines that run on every merge request and main branch commit:
### Quality Assurance
- **Code Testing**: Comprehensive test suite using `tox` and `pytest` with coverage reporting
- **Code Formatting**: Automated formatting with `black` and import sorting with `isort`
- **Code Style**: Style checking with `flake8` following project standards
- **Type Checking**: Static type analysis using `mypy` for type safety
- **Security Scanning**:
- Dependency vulnerability checks with `safety`
- Code security analysis with `bandit` (excluding test files)
### Deployment
- **Automated Building**: Package building and integrity validation
- **PyPI Deployment**: Automatic deployment to PyPI on tagged releases
- **Manual Release**: Production deployments require manual approval for safety
The same quality checks can be run locally using the included `format_and_check.py` script.
## 📄 License
This project is licensed under the GNU Affero General Public License v3.0. See [LICENSE](LICENSE) for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "decoguard",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.13",
"maintainer_email": null,
"keywords": "decorators, validation, meta-decorator, introspection",
"author": "Shacode",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/6a/9d/2f52bab475f7a90e81143b9017130c0499e431c4ac0f65fa47e17fcd022f/decoguard-0.1.1.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <img src=\"https://gitlab.com/Shacode/decoguard/-/raw/main/docs/logo.png\" alt=\"decoguard logo\" width=\"250\">\n</div>\n\n# \ud83d\udee1\ufe0f DECOGUARD\n[](https://gitlab.com/Shacode/decoguard/-/releases)\n[](https://gitlab.com/Shacode/decoguard/-/pipelines)\n[](https://gitlab.com/Shacode/decoguard/-/jobs)\n[](https://decoguard.readthedocs.io/en/latest/)\n[](https://www.gnu.org/licenses/agpl-3.0)\n[](https://www.python.org/)\n[](https://gitlab.com/Shacode/decoguard)\n\nLightweight Python library for robustly validating decorated functions, providing a clean, structured way to ensure they comply with defined conditions.\n\n[\ud83d\udcda The complete documentation is available here.](https://decoguard.readthedocs.io/en/latest/)\n\n## \u2728 Features\n\n- **Meta-Decorators**: Easily add validation logic to your decorators and decorator factories.\n- **Validator Functions**: Fine-grained validation rules for function signatures and usage.\n- **Assertion Utilities**: Reusable assertion helpers for standalone validation.\n- **Centralized Validation**: Keep your validation logic clean and maintainable.\n- **Clear Error Reporting**: Developer-friendly exceptions for invalid decorator usage.\n- **Drop-In Simplicity**: Integrate with existing Python code with minimal changes.\n\n## \ud83d\ude80 Getting Started\n\n1. **Install decoguard**\n ```bash\n pip install decoguard\n ```\n2. **Import and use meta-decorators**\n ```python\n from decoguard.decorators import validate_decorated\n from decoguard.validators import require_params\n\n @validate_decorated(require_params(\"x\", \"y\"))\n def my_decorator(func): return func\n\n @my_decorator\n def correct_usage(x, y): pass\n\n @my_decorator\n def bad_usage(x): pass # Will raise DecoratorUsageValidationError\n ```\n\n## \ud83d\udc9a CI/CD Pipeline\n\nThis project maintains high code quality through automated GitLab CI/CD pipelines that run on every merge request and main branch commit:\n\n### Quality Assurance\n- **Code Testing**: Comprehensive test suite using `tox` and `pytest` with coverage reporting\n- **Code Formatting**: Automated formatting with `black` and import sorting with `isort`\n- **Code Style**: Style checking with `flake8` following project standards\n- **Type Checking**: Static type analysis using `mypy` for type safety\n- **Security Scanning**:\n - Dependency vulnerability checks with `safety`\n - Code security analysis with `bandit` (excluding test files)\n\n### Deployment\n- **Automated Building**: Package building and integrity validation\n- **PyPI Deployment**: Automatic deployment to PyPI on tagged releases\n- **Manual Release**: Production deployments require manual approval for safety\n\nThe same quality checks can be run locally using the included `format_and_check.py` script.\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the GNU Affero General Public License v3.0. See [LICENSE](LICENSE) for details.\n",
"bugtrack_url": null,
"license": null,
"summary": "Lightweight Python library for robustly validating decorated functions, providing a clean, structured way to ensure they comply with defined conditions.",
"version": "0.1.1",
"project_urls": {
"Bug Tracker": "https://gitlab.com/Shacode/decoguard/-/issues",
"Documentation": "https://decoguard.readthedocs.io/en/latest/",
"Homepage": "https://gitlab.com/Shacode/decoguard",
"Repository": "https://gitlab.com/Shacode/decoguard"
},
"split_keywords": [
"decorators",
" validation",
" meta-decorator",
" introspection"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "28565a5caac191f39c96ecef9c001b4eae4dc11b93da9c1681afcad76178135e",
"md5": "6c22dc2999ed5391bc2aae1e2f097313",
"sha256": "9d7b01c66b238027724e409ab8c77ff294e084fdbf8f41fe2c56da1f8dc41d3b"
},
"downloads": -1,
"filename": "decoguard-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6c22dc2999ed5391bc2aae1e2f097313",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.13",
"size": 21838,
"upload_time": "2025-08-07T07:54:40",
"upload_time_iso_8601": "2025-08-07T07:54:40.612646Z",
"url": "https://files.pythonhosted.org/packages/28/56/5a5caac191f39c96ecef9c001b4eae4dc11b93da9c1681afcad76178135e/decoguard-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6a9d2f52bab475f7a90e81143b9017130c0499e431c4ac0f65fa47e17fcd022f",
"md5": "b7f76020eb1f52fd039986a0ddfc17ff",
"sha256": "4730c17b2d1f44d08242152de18332653dd6831e6d9d4c6cc9ddfe27c0ae187c"
},
"downloads": -1,
"filename": "decoguard-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "b7f76020eb1f52fd039986a0ddfc17ff",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.13",
"size": 27907,
"upload_time": "2025-08-07T07:54:41",
"upload_time_iso_8601": "2025-08-07T07:54:41.767184Z",
"url": "https://files.pythonhosted.org/packages/6a/9d/2f52bab475f7a90e81143b9017130c0499e431c4ac0f65fa47e17fcd022f/decoguard-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-07 07:54:41",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "Shacode",
"gitlab_project": "decoguard",
"lcname": "decoguard"
}