pyvalid
pyvalid copied to clipboard
:white_check_mark: Python values validator
Currently when a exception is raised, the error message does not specify which exact validation method failed. This code change allows the user to add customized messages to the exceptions,...
Create chainable shorthands for pyvalid's validators. It may be useful for cases, when we just need to quickly verify some value without preparing comprehensive validators. Examples: ```python from pyvalid import...
Provide an ability to turn off/on particular decorators. For example, it should be possible to turn off the `@accepts` decorator and keep the `@returns` decorator enabled. It should be done...
Provide an ability to validate objects against the schema
We need to make the pyvalid package lightweight and easy to install. Therefore it would be great to try to avoid too heavy deps such as `torch` (which is about...
``` from pyvalid import accepts import pandas as pd from pyvalid.validators import NumberValidator class Mention: @accepts(object, overlap_percentage=NumberValidator(min_val=0.0, max_val=1.0) ) def __init__(self, df: pd.DataFrame, presence_col: str, overlap_percentage=1.2) -> None: pass Mention(None,"abc",0.9)...
Provide the ability to validate input/output values base on [type hints](https://docs.python.org/3/library/typing.html). It's possible to use `inspect.signature`, `typing.get_origin()`, `typing.get_args()`, etc for retrieving information about type hints. We'll need to create decorator,...
We need to improve unit tests coverage in order to reach the value close to 100% How to: 1. Analyze existing code base using the `coverage` package 2. Review report...