fluent-validator


Namefluent-validator JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/mariotaddeucci/fluent_validator
SummaryPackage to validate data in a fluent way
upload_time2023-08-27 02:35:03
maintainer
docs_urlNone
authorMario Taddeuci
requires_python
license
keywords validator check fluent assert
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            \n
# fluent_validator

**Validate Your Data with Ease!**

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI version](https://badge.fury.io/py/fluent-validator.svg)](https://badge.fury.io/py/fluent-validator)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/fluent-validator)](https://pypi.org/project/fluent-validator/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fluent-validator.svg)](https://pypi.org/project/fluent-validator/)
[![GitHub stars](https://img.shields.io/github/stars/mariotaddeucci/fluent_validator.svg?style=flat-square)](https://github.com/mariotaddeucci/fluent_validator/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/mariotaddeucci/fluent_validator.svg?style=flat-square)](https://github.com/mariotaddeucci/fluent_validator/network)
[![GitHub license](https://img.shields.io/github/license/mariotaddeucci/fluent_validator.svg?style=flat-square)](https://github.com/mariotaddeucci/fluent_validator/blob/main/LICENSE)

## 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](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Available Validations](#available-validations)
- [License](#license)
- [Support](#support)


## Features

- **Fluent Syntax**: Define validation rules in a clean and fluent manner.
- **No Extra Dependencies**: `fluent_validator` is 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:

```bash
pip install fluent-validator
````

## Usage

Here's a quick example of how to use `fluent_validator`:

```python
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](LICENSE) file for details.

## Support

If you encounter any issues or have questions about `fluent_validator`, please feel free to [open an issue](https://github.com/mariotaddeucci/fluent_validator/issues). We're here to help!

Happy Validating! 🚀

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mariotaddeucci/fluent_validator",
    "name": "fluent-validator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "validator,check,fluent,assert",
    "author": "Mario Taddeuci",
    "author_email": "mariotaddeucci@gmx.com",
    "download_url": "https://files.pythonhosted.org/packages/36/90/6865f78f054a808c2f38f1f3ed985d876f504ddf5bb3f488cee28f36d175/fluent_validator-0.1.0.tar.gz",
    "platform": null,
    "description": "\\n\n# fluent_validator\n\n**Validate Your Data with Ease!**\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![PyPI version](https://badge.fury.io/py/fluent-validator.svg)](https://badge.fury.io/py/fluent-validator)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/fluent-validator)](https://pypi.org/project/fluent-validator/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fluent-validator.svg)](https://pypi.org/project/fluent-validator/)\n[![GitHub stars](https://img.shields.io/github/stars/mariotaddeucci/fluent_validator.svg?style=flat-square)](https://github.com/mariotaddeucci/fluent_validator/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/mariotaddeucci/fluent_validator.svg?style=flat-square)](https://github.com/mariotaddeucci/fluent_validator/network)\n[![GitHub license](https://img.shields.io/github/license/mariotaddeucci/fluent_validator.svg?style=flat-square)](https://github.com/mariotaddeucci/fluent_validator/blob/main/LICENSE)\n\n## Overview\n\n`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.\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Available Validations](#available-validations)\n- [License](#license)\n- [Support](#support)\n\n\n## Features\n\n- **Fluent Syntax**: Define validation rules in a clean and fluent manner.\n- **No Extra Dependencies**: `fluent_validator` is lightweight and doesn't require any additional packages.\n- **Python 3.7+ Support**: It works seamlessly with Python versions 3.7, 3.8, 3.9, 3.10, and 3.11.\n- **Extensive Validation Library**: Check out our extensive list of available validations to cover all your validation needs.\n\n## Installation\n\nYou can install `fluent_validator` using pip:\n\n```bash\npip install fluent-validator\n````\n\n## Usage\n\nHere's a quick example of how to use `fluent_validator`:\n\n```python\nfrom fluent_validator import validate, validate_all\n\n# Validate a single value\nvalidate(10).not_is_none().greater_than(5).not_equal(40)\n\n# Or validate multiple values\nvalidate_all(10, 100).not_is_none().greater_than(5).not_equal(40)\n```\n\n## Available Validations\n\n`fluent_validator` offers a wide range of validations to suit your needs.\n\nNotably, all validations have a corresponding negative form. Simply prefix the method with `not_`.\n\nFor example, the negative of `is_none()` is `not_is_none()`.\n\n### Check out the full list of available above.\n\n| Validation | Description |\n| --- | --- |\n| `between(min_vl, max_vl)` | Check if the object is within the specified range. |\n| `contains_at_least(value)` | Check if the object (assumed to be iterable) contains at least the specified number of elements. |\n| `contains_at_most(value)` | Check if the object (assumed to be iterable) contains at most the specified number of elements. |\n| `contains_exactly(value)` | Check if the object (assumed to be iterable) contains exactly the specified number of elements. |\n| `equal(value)` | Check if the object is equal to the specified value. |\n| `greater_or_equal_than(value)` | Check if the object is greater than or equal to the specified value. |\n| `greater_than(value)` | Check if the object is greater than the specified value. |\n| `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. |\n| `is_bool()` | Check if the object is a boolean. |\n| `is_callable()` | Check if the object is callable (e.g., a function or method). |\n| `is_false()` | Check if the object is a boolean and has a value of False. |\n| `is_in()` | Check if the object is in a collection of values. |\n| `is_instance()` | Check if the object is an instance of one or more specified types. |\n| `is_iterable()` | Check if the object is iterable. |\n| `is_none()` | Check if the object is None. |\n| `is_number()` | Check if the object is a number (int or float). |\n| `is_string()` | Check if the object is a string. |\n| `is_true()` | Check if the object is a boolean and has a value of True. |\n| `less_or_equal_than(value)` | Check if the object is less than or equal to the specified value. |\n| `less_than(value)` | Check if the object is less than the specified value. |\n| `max(value)` | Check if the object is less than or equal to the specified maximum value. |\n| `min(value)` | Check if the object is greater than or equal to the specified minimum value. |\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\nIf you encounter any issues or have questions about `fluent_validator`, please feel free to [open an issue](https://github.com/mariotaddeucci/fluent_validator/issues). We're here to help!\n\nHappy Validating! \ud83d\ude80\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Package to validate data in a fluent way",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/mariotaddeucci/fluent_validator"
    },
    "split_keywords": [
        "validator",
        "check",
        "fluent",
        "assert"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d5ecebb1af8e026261fdf3fe3a53fd41403c6fb4f53c8bb891b07cfdf632a76",
                "md5": "3549d07bc71b10eca4938b48fdb05b89",
                "sha256": "e40454712ec7afad573c689515e07a452e4ae1da24b5f389a45bb727f268ddcf"
            },
            "downloads": -1,
            "filename": "fluent_validator-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3549d07bc71b10eca4938b48fdb05b89",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6357,
            "upload_time": "2023-08-27T02:35:02",
            "upload_time_iso_8601": "2023-08-27T02:35:02.200228Z",
            "url": "https://files.pythonhosted.org/packages/9d/5e/cebb1af8e026261fdf3fe3a53fd41403c6fb4f53c8bb891b07cfdf632a76/fluent_validator-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36906865f78f054a808c2f38f1f3ed985d876f504ddf5bb3f488cee28f36d175",
                "md5": "5f56ce8a4b6704ecac1066d89bb2d486",
                "sha256": "37398a58479efbefde996a7f96bca670e8b728053a8fc62d42aa6f1eb07a1c3e"
            },
            "downloads": -1,
            "filename": "fluent_validator-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5f56ce8a4b6704ecac1066d89bb2d486",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5217,
            "upload_time": "2023-08-27T02:35:03",
            "upload_time_iso_8601": "2023-08-27T02:35:03.659671Z",
            "url": "https://files.pythonhosted.org/packages/36/90/6865f78f054a808c2f38f1f3ed985d876f504ddf5bb3f488cee28f36d175/fluent_validator-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-27 02:35:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mariotaddeucci",
    "github_project": "fluent_validator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "fluent-validator"
}
        
Elapsed time: 0.10411s