Function Validator library comes with a req_validator decorator that validates the function keyword argument against its datatype, keyword name, required and logs the keyerror that you provide in the error description.
Installation Instruction!
===================
>- Activate your Virtual Environment.
>- pip install function-validator
----------
**function-validator** is library having req_validator decorator that validates the request parameters.
# Usage
1. Import function logger library
- `from function_validator import req_validator`
# Example
```python
from function_validator import req_validator
@req_validator(param_name="age", err_description="int not found", req=True, var_type=int)
@req_validator(param_name="name", err_description="string not found", req=True, var_type=basestring)
@req_validator(param_name="quality", err_description="dict not found", req=True, var_type=dict)
@req_validator(param_name="friend_list", err_description="list not found", req=True, var_type=list)
def test_function(**kwargs):
print kwargs
if __name__ == '__main__':
test_function(age = 23, name = "Anand", quality = {"height": 172}, friend_list = ["anand"])
```
Metadata
Release files for function-validator 0.1
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 | Actions |
|---|---|---|---|---|
| function_validator-0.1.tar.gz | 1.8 kB | Without provenance | Details for function_validator-0.1.tar.gz |
Release files / function_validator-0.1.tar.gz
| Download URL | function_validator-0.1.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c2bd2a105f15c7d60ab94cf89f831af5c3cbd289fb921dbc2fec9f6dc48987c
|
|
BLAKE2b-256 checksum How to use checksums |
e653263da09d33110624e54f5cf84282cbb16aae549c4703bdca08f1bf68960a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for function-validator 0.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.