semvec/pypi-packages huggingface dataset:
jons 0.1.0
JONS is a dependency allowing you to validate multiple data types in a precise and fast way
License: MIT
Keywords: schema,validator,json,hivi

# @hivi/jons

## Presentation

**JONS** is a dependency allowing you to validate multiple data types in a precise and fast way.

## Installation

```console
pip install JONS
```
## Use

### Number

```python
import JONS
value = 12
# init validation
# res = JONS.Number().required().default(10).label('entier1').validate(value)
# min
# res = JONS.Number().min(5).required().label('entier1').validate(value)
# max
# res = JONS.Number().min(5).max(50).required().label('entier1').applyApp(
#     rule = lambda value: value > 40,
# ).applyMapping(lambda value: value * 10).defaultError({
#     'fr': "votre element est invalide",
#     'en': "your element is invalid",
# }).validate(value)
# less
# res = JONS.Number().less(5).required().label('entier1').validate(value)
# greater
# res = JONS.Number().less(5).greater(50).required().label('entier1').validate(value)
# negative
# res = JONS.Number().negative().label('entier1').validate(value)
# positive
# res = JONS.Number().positive().min(11).label('entier1').validate(value)
# signed
# res = JONS.Number().signed().label('entier1').validate(value)
# integer
# res = JONS.Number().integer().label('entier1').validate(value)
# decimal
# res = JONS.Number().decimal().label('entier1').validate(value)
# multiple
# res = JONS.Number().multiple(3).label('entier1').validate(value)
# port
res = JONS.Number().TCPPort().label('entier1').validate(value)

print("> res:: ", res)
print("> res['error']:: ", res['error'])
return res
```

#### .min(min_value)

```py
import JONS
schema = JONS.Number()
const schema = new JONS.Number().min(3)
```

##### Arguments

| Property | Description | Type |
| :-------- | :---------- | :--- |
| **min_value** | the number to be validated must be less than or equal to min_value | **Number** |

## Useful links

* [Git](/ "https://ntouba98@bitbucket.org/ntouba98/jonpy.git")
* [Nodejs dependency](/ "https://pypi.org/project/JONS/")