Metadata-Version: 2.4
Name: bagof-validators
Version: 0.1
Summary: Hint-based runtime validators.
Author-email: Yael Balbastre <yael.balbastre@gmail.com>
Maintainer-email: Yael Balbastre <yael.balbastre@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/bagofseeds/bagof-validators
Project-URL: Documentation, https://github.com/bagofseeds/bagof-validators#readme
Project-URL: Issues, https://github.com/bagofseeds/bagof-validators/issues
Project-URL: Repository, https://github.com/bagofseeds/bagof-validators
Keywords: bagof,validators,python
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing_extensions>=4.13
Requires-Dist: bagof-hints~=0.1
Requires-Dist: bagof-core-magic~=0.1
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-cov>=4; extra == "test"
Requires-Dist: numpy; extra == "test"
Dynamic: license-file

# bagof-validators

Hint-based validators that operate at runtime.

## Example

```pycon
>>> from collections import abc
>>> from bagof.validators import get_validator
>>> validate = get_validator(abc.Sequence[int])
>>> validate([1, 2, 3])
>>> validate(1)
TypeValidationError: IsSequence(collections.abc.Sequence[int]): Not a valid instance.
|> value = 1
>>> validate(["a", "b", "c"])
ValueValidationError: IsSequence(collections.abc.Sequence[int]): Iterable's 0th element is not valid.
|> value = ['a', 'b', 'c']
```
