pandas-validate


Namepandas-validate JSON
Version 1.0.2 PyPI version JSON
download
home_page
SummaryA python package used for validating pandas dataframes.
upload_time2023-05-18 15:26:07
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2023 larrygreen3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords pandas validate validation schema types
VCS
bugtrack_url
requirements dateparser iniconfig numpy packaging pandas pluggy pytest python-dateutil pytz pytz-deprecation-shim regex six tzdata tzlocal
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pandas_validate

<!-- Badges -->
[![PyPI Latest Release](https://img.shields.io/pypi/v/pandas-validate.svg)](https://pypi.org/project/pandas-validate/)
[![Package Status](https://img.shields.io/pypi/status/pandas-validate.svg)](https://pypi.org/project/pandas-validate/)
[![License](https://img.shields.io/pypi/l/pandas-validate.svg)](https://github.com/larrygreen3/pandas-validate/blob/main/LICENSE)
[![Package Status](https://img.shields.io/pypi/dm/pandas-validate.svg)](https://pypistats.org/packages/pandas-validate)

> A python package used for validating pandas dataframes.


## ⚙️ Installation
```sh
python -m pip install pandas_validate
```


## 🚀 Usage

```python
# Imports
import pandas as pd

from pandas_validate import Schema
from pandas_validate.columns import IntColumn, TextColumn


# Define your Schema
class MySchema(Schema):
	IntField = IntColumn(min_value=3, max_value=10)
	TextField = TextColumn(min_length=3, max_length=5, pattern="^[a-c]+$")


# Get your DataFrame
df = pd.DataFrame({
	'IntField': [1, 6, 11, 7],
	'TextField': ['ab', 'abcd', 'ccbbaa', 'ccb'],
	'UnknownField': [1, 2, 3, 4]
})


# Validate your DataFrame
validated_df, exceptions = MySchema.validate(df)
```

Results
```python
>>> print(validated_df)

   IntField TextField
0       NaN      None
1       6.0      None
2       NaN      None
3       7.0       ccb


>>> print(exceptions)

         column  row   value                     error                                      error_details
0      IntField  0.0       1  Column validation failed                                    The value 1 < 3
1      IntField  2.0      11  Column validation failed                                  The value 11 < 10
2     TextField  0.0      ab  Column validation failed                          The value ab is too short
3     TextField  1.0    abcd  Column validation failed  The value abcd does not match the regular expr...
4     TextField  2.0  ccbbaa  Column validation failed                       The value ccbbaa is too long
5  UnknownField  NaN    None            Unknown Column     The column "UnknownField" is not in the Schema

```



## Code Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].

[Current Contributors](https://github.com/larrygreen3/pandas-validate/graphs/contributors)


## 🤝 Contributing

Contributions, issues and feature requests are welcome.<br />
Feel free to check [issues page](https://github.com/larrygreen3/pandas-validate/issues) if you want to contribute.<br />
[Check the contributing guide](CONTRIBUTING.md).<br />

## Author

👤 **Larry Green**

- Github: [@larrygreen3](https://github.com/larrygreen3)

## Show your support

Please ⭐️ this repository if this project helped you!


## 📝 License

Copyright © 2023 [Larry Green](https://github.com/larrygreen3).<br />
This project is [MIT](https://github.com/larrygreen3/pandas-validate/blob/master/LICENSE) licensed.

---

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pandas-validate",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "pandas,validate,validation,schema,types",
    "author": "",
    "author_email": "Larry Green <larrygreen@duck.com>",
    "download_url": "https://files.pythonhosted.org/packages/e0/61/a34c9c0c5431ade3543e486a9f75eed0b2eab144f2c390fbab5cc3e6b6aa/pandas-validate-1.0.2.tar.gz",
    "platform": null,
    "description": "# pandas_validate\n\n<!-- Badges -->\n[![PyPI Latest Release](https://img.shields.io/pypi/v/pandas-validate.svg)](https://pypi.org/project/pandas-validate/)\n[![Package Status](https://img.shields.io/pypi/status/pandas-validate.svg)](https://pypi.org/project/pandas-validate/)\n[![License](https://img.shields.io/pypi/l/pandas-validate.svg)](https://github.com/larrygreen3/pandas-validate/blob/main/LICENSE)\n[![Package Status](https://img.shields.io/pypi/dm/pandas-validate.svg)](https://pypistats.org/packages/pandas-validate)\n\n> A python package used for validating pandas dataframes.\n\n\n## \u2699\ufe0f Installation\n```sh\npython -m pip install pandas_validate\n```\n\n\n## \ud83d\ude80 Usage\n\n```python\n# Imports\nimport pandas as pd\n\nfrom pandas_validate import Schema\nfrom pandas_validate.columns import IntColumn, TextColumn\n\n\n# Define your Schema\nclass MySchema(Schema):\n\tIntField = IntColumn(min_value=3, max_value=10)\n\tTextField = TextColumn(min_length=3, max_length=5, pattern=\"^[a-c]+$\")\n\n\n# Get your DataFrame\ndf = pd.DataFrame({\n\t'IntField': [1, 6, 11, 7],\n\t'TextField': ['ab', 'abcd', 'ccbbaa', 'ccb'],\n\t'UnknownField': [1, 2, 3, 4]\n})\n\n\n# Validate your DataFrame\nvalidated_df, exceptions = MySchema.validate(df)\n```\n\nResults\n```python\n>>> print(validated_df)\n\n   IntField TextField\n0       NaN      None\n1       6.0      None\n2       NaN      None\n3       7.0       ccb\n\n\n>>> print(exceptions)\n\n         column  row   value                     error                                      error_details\n0      IntField  0.0       1  Column validation failed                                    The value 1 < 3\n1      IntField  2.0      11  Column validation failed                                  The value 11 < 10\n2     TextField  0.0      ab  Column validation failed                          The value ab is too short\n3     TextField  1.0    abcd  Column validation failed  The value abcd does not match the regular expr...\n4     TextField  2.0  ccbbaa  Column validation failed                       The value ccbbaa is too long\n5  UnknownField  NaN    None            Unknown Column     The column \"UnknownField\" is not in the Schema\n\n```\n\n\n\n## Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\n[Current Contributors](https://github.com/larrygreen3/pandas-validate/graphs/contributors)\n\n\n## \ud83e\udd1d Contributing\n\nContributions, issues and feature requests are welcome.<br />\nFeel free to check [issues page](https://github.com/larrygreen3/pandas-validate/issues) if you want to contribute.<br />\n[Check the contributing guide](CONTRIBUTING.md).<br />\n\n## Author\n\n\ud83d\udc64 **Larry Green**\n\n- Github: [@larrygreen3](https://github.com/larrygreen3)\n\n## Show your support\n\nPlease \u2b50\ufe0f this repository if this project helped you!\n\n\n## \ud83d\udcdd License\n\nCopyright \u00a9 2023 [Larry Green](https://github.com/larrygreen3).<br />\nThis project is [MIT](https://github.com/larrygreen3/pandas-validate/blob/master/LICENSE) licensed.\n\n---\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 larrygreen3  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A python package used for validating pandas dataframes.",
    "version": "1.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/larrygreen3/pandas-validate/issues",
        "Homepage": "https://github.com/larrygreen3/pandas-validate"
    },
    "split_keywords": [
        "pandas",
        "validate",
        "validation",
        "schema",
        "types"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5a8204ddce4f4c07ef4ffe2a728bf5794f63e04fc97aaf4a587f32c66c6d94b6",
                "md5": "a9df223625ed863e4c08481327782394",
                "sha256": "60b0f66634281fe76713544bb5bee1f3a723ca1a7dab6959aa235b16f2e2168b"
            },
            "downloads": -1,
            "filename": "pandas_validate-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a9df223625ed863e4c08481327782394",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10391,
            "upload_time": "2023-05-18T15:26:06",
            "upload_time_iso_8601": "2023-05-18T15:26:06.309717Z",
            "url": "https://files.pythonhosted.org/packages/5a/82/04ddce4f4c07ef4ffe2a728bf5794f63e04fc97aaf4a587f32c66c6d94b6/pandas_validate-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e061a34c9c0c5431ade3543e486a9f75eed0b2eab144f2c390fbab5cc3e6b6aa",
                "md5": "9d9e84a9528cd3ee8f7aa8890567acf4",
                "sha256": "7dd62e5dbac978b82ca30d9e7ab9082e2b347278f5e91a1b4bf71a1f5ba21e07"
            },
            "downloads": -1,
            "filename": "pandas-validate-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "9d9e84a9528cd3ee8f7aa8890567acf4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10331,
            "upload_time": "2023-05-18T15:26:07",
            "upload_time_iso_8601": "2023-05-18T15:26:07.667454Z",
            "url": "https://files.pythonhosted.org/packages/e0/61/a34c9c0c5431ade3543e486a9f75eed0b2eab144f2c390fbab5cc3e6b6aa/pandas-validate-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-18 15:26:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "larrygreen3",
    "github_project": "pandas-validate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "dateparser",
            "specs": [
                [
                    "==",
                    "1.1.8"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.24.3"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "23.1"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.3.1"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.8.2"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2023.3"
                ]
            ]
        },
        {
            "name": "pytz-deprecation-shim",
            "specs": [
                [
                    "==",
                    "0.1.0.post0"
                ]
            ]
        },
        {
            "name": "regex",
            "specs": [
                [
                    "==",
                    "2023.5.5"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "tzdata",
            "specs": [
                [
                    "==",
                    "2023.3"
                ]
            ]
        },
        {
            "name": "tzlocal",
            "specs": [
                [
                    "==",
                    "4.3"
                ]
            ]
        }
    ],
    "lcname": "pandas-validate"
}
        
Elapsed time: 0.06915s