\n
fluent_validator
Validate Your Data with Ease!
Overview
fluent_validator is a Python package that makes data validation a breeze! Say goodbye to complex, nested if statements and hello to a fluent and expressive way to validate your data. With fluent_validator, you can easily define and execute validation rules for your data in a clean and readable manner.
Features
- Fluent Syntax: Define validation rules in a clean and fluent manner.
- No Extra Dependencies:
fluent_validatoris lightweight and doesn't require any additional packages. - Python 3.7+ Support: It works seamlessly with Python versions 3.7, 3.8, 3.9, 3.10, and 3.11.
- Extensive Validation Library: Check out our extensive list of available validations to cover all your validation needs.
Installation
You can install fluent_validator using pip:
pip install fluent-validator
Usage
Here's a quick example of how to use fluent_validator:
from fluent_validator import validate, validate_all
# Validate a single value
validate(10).not_is_none().greater_than(5).not_equal(40)
# Or validate multiple values
validate_all(10, 100).not_is_none().greater_than(5).not_equal(40)
Available Validations
fluent_validator offers a wide range of validations to suit your needs.
Notably, all validations have a corresponding negative form. Simply prefix the method with not_.
For example, the negative of is_none() is not_is_none().
Check out the full list of available above.
| Validation | Description |
|---|---|
between(min_vl, max_vl) |
Check if the object is within the specified range. |
contains_at_least(value) |
Check if the object (assumed to be iterable) contains at least the specified number of elements. |
contains_at_most(value) |
Check if the object (assumed to be iterable) contains at most the specified number of elements. |
contains_exactly(value) |
Check if the object (assumed to be iterable) contains exactly the specified number of elements. |
equal(value) |
Check if the object is equal to the specified value. |
greater_or_equal_than(value) |
Check if the object is greater than or equal to the specified value. |
greater_than(value) |
Check if the object is greater than the specified value. |
has_unique_values() |
Check if the object (assumed to be iterable) contains unique values. Note: This function assumes that the object's elements are hashable. |
is_bool() |
Check if the object is a boolean. |
is_callable() |
Check if the object is callable (e.g., a function or method). |
is_false() |
Check if the object is a boolean and has a value of False. |
is_in() |
Check if the object is in a collection of values. |
is_instance() |
Check if the object is an instance of one or more specified types. |
is_iterable() |
Check if the object is iterable. |
is_none() |
Check if the object is None. |
is_number() |
Check if the object is a number (int or float). |
is_string() |
Check if the object is a string. |
is_true() |
Check if the object is a boolean and has a value of True. |
less_or_equal_than(value) |
Check if the object is less than or equal to the specified value. |
less_than(value) |
Check if the object is less than the specified value. |
max(value) |
Check if the object is less than or equal to the specified maximum value. |
min(value) |
Check if the object is greater than or equal to the specified minimum value. |
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions about fluent_validator, please feel free to open an issue. We're here to help!
Happy Validating! 🚀
Metadata
Release files for fluent-validator 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 | |
|---|---|---|---|---|
| fluent_validator-0.1.0.tar.gz | 5.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fluent_validator-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / fluent_validator-0.1.0.tar.gz
| Download URL | fluent_validator-0.1.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37398a58479efbefde996a7f96bca670e8b728053a8fc62d42aa6f1eb07a1c3e
|
|
BLAKE2b-256 checksum How to use checksums |
36906865f78f054a808c2f38f1f3ed985d876f504ddf5bb3f488cee28f36d175
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / fluent_validator-0.1.0-py3-none-any.whl
| Download URL | fluent_validator-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e40454712ec7afad573c689515e07a452e4ae1da24b5f389a45bb727f268ddcf
|
|
BLAKE2b-256 checksum How to use checksums |
9d5ecebb1af8e026261fdf3fe3a53fd41403c6fb4f53c8bb891b07cfdf632a76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for fluent-validator 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.