Arganic
Arganic is a simple and lightweight Python library making it easy to manage Arguments for Classes, Methods or Functions.
The library provides a very simple and comprehensive set of decorators with advanced features such as required arguments, validators, type checking, read/write accesses, default values, and choices.
By leveraging Python's *args and **kwargs, Arganic
empowers developers to enhance the readability and functionality of
their codebase with ease.
Key Features:
- Decorators for Classes, Methods, and Functions: Apply decorators to classes, methods, and functions to extend their functionality and behavior.
- Required Parameters: Define required parameters for methods and functions to ensure essential inputs are provided.
- Validator Support: Validate method arguments, function parameters, and class properties using built-in or custom validators.
- Type Checking: Enforce type constraints and ensure type consistency with flexible type checking capabilities.
- Read/Write Access Control: Define read-only properties for classes, methods, and functions as needed.
- Default Values: Set default values for function arguments, method parameters, and class properties to streamline code logic.
- Choice Selection: Specify a list of choices for method arguments and function parameters, restricting input values to predefined options.
Decorators
Arganic provides 3 distinct types of decorators:
@class_properties: A decorator for class properties allowing you to define the data managed by the class during construction and then access these values within the class.@method_arguments: A decorator for class methods allowing you to constrain the arguments provided during the call but also to find the correctly formatted values within the method.@function_arguments: A decorator for functions allowing you to constrain the arguments provided during the call but also to find the correctly formatted values within the function.
Installation
Pip
Install Arganic via the pip command:
pip install arganic
Git clone
Clone the github repository:
git clone https://github.com/Kiwea/arganic
Contributing
This project is open and gratefully accepts any form of contribution.
Contributing to the code
Create a virtual env:
cd Arganic
python -m venv venv
source venv/bin/activate
Test the code:
pytest --cov=arganic/
Create a feature branch:
git checkout -b my-feature
Add your code and test it again Update the documentation under the docs/
mkdocs serve
Submit a push request...
Issues
If you find a bug, please post an issue on the issue tracker on GitHub.
To help reproduce the bug, please provide a minimal reproducible example, including a code snippet and the full error message.
Metadata
Release files for Arganic 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| arganic-0.1.0.tar.gz | 20.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Arganic-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.5 kB
Release files / arganic-0.1.0.tar.gz
| Download URL | arganic-0.1.0.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee4a76624b4f8d39fb58a117d0474e933282d5c1d152196a345106702692f1a3
|
|
BLAKE2b-256 checksum How to use checksums |
4c8454fbc1681b8252404aa5547a0a147791966683c80cb9f10c2f273534b6f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / Arganic-0.1.0-py3-none-any.whl
| Download URL | Arganic-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3d729f27575423a2c8d7d7cfb9c69cdc86186034bbab80543faa710508b2af1
|
|
BLAKE2b-256 checksum How to use checksums |
4d3869142eb48ddede0052225d27c056ac47e98c6c787460bd794d426599d383
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for Arganic 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.