Lightweight Python library for robustly validating decorated functions, providing a clean, structured way to ensure they comply with defined conditions.
Project description
🛡️ DECOGUARD
Lightweight Python library for robustly validating decorated functions, providing a clean, structured way to ensure they comply with defined conditions.
✨ 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
- Install decoguard
pip install decoguard
- Import and use meta-decorators
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
📄 License
This project is licensed under the GNU Affero General Public License v3.0. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decoguard-0.1.0.tar.gz.
File metadata
- Download URL: decoguard-0.1.0.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aab57dbb086421243aecbe55f61b28321d54f37d6c765f928b489915b5c208b1
|
|
| MD5 |
4f6222988d66b9c765a7b036723f7db6
|
|
| BLAKE2b-256 |
544f29a9d8af069aea1aa09cdf7fee9402dcbc1a13df7fb02bcc3911b1dddc83
|
File details
Details for the file decoguard-0.1.0-py3-none-any.whl.
File metadata
- Download URL: decoguard-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
867db164fe2b72e57784d395eb2a7b3cdbf18352b241fadb3e1ad816e80943c6
|
|
| MD5 |
093e58457f5e9a10c07abc5754991409
|
|
| BLAKE2b-256 |
57187036007230eb314cec71cd0644da81809b1a2b57c864fb62a90792b4e83a
|