Metadata-Version: 2.4
Name: pandera
Version: 0.26.1
Summary: A light-weight and flexible data validation and testing tool for statistical data objects.
Author-email: Niels Bantilan <niels.bantilan@gmail.com>
License: MIT License
        
        Copyright (c) 2018 Niels Bantilan
        
        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.
        
Project-URL: Documentation, https://pandera.readthedocs.io
Project-URL: Issue Tracker, https://github.com/pandera-dev/pandera/issues
Project-URL: Homepage, https://github.com/pandera-dev/pandera
Keywords: pandas,validation,data-structures
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
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.13
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: packaging>=20.0
Requires-Dist: pydantic
Requires-Dist: typeguard
Requires-Dist: typing_extensions
Requires-Dist: typing_inspect>=0.6.0
Provides-Extra: pandas
Requires-Dist: numpy>=1.24.4; extra == "pandas"
Requires-Dist: pandas>=2.1.1; extra == "pandas"
Provides-Extra: strategies
Requires-Dist: hypothesis>=6.92.7; extra == "strategies"
Provides-Extra: hypotheses
Requires-Dist: scipy; extra == "hypotheses"
Provides-Extra: io
Requires-Dist: pyyaml>=5.1; extra == "io"
Requires-Dist: black; extra == "io"
Requires-Dist: frictionless<=4.40.8; extra == "io"
Provides-Extra: mypy
Requires-Dist: pandas-stubs; extra == "mypy"
Provides-Extra: fastapi
Requires-Dist: fastapi; extra == "fastapi"
Provides-Extra: geopandas
Requires-Dist: geopandas<1.1.0; extra == "geopandas"
Requires-Dist: shapely; extra == "geopandas"
Provides-Extra: pyspark
Requires-Dist: pyspark[connect]<4.0.0,>=3.2.0; extra == "pyspark"
Provides-Extra: modin
Requires-Dist: modin; extra == "modin"
Requires-Dist: ray; extra == "modin"
Requires-Dist: dask[dataframe]; extra == "modin"
Requires-Dist: distributed; extra == "modin"
Provides-Extra: modin-ray
Requires-Dist: modin; extra == "modin-ray"
Requires-Dist: ray; extra == "modin-ray"
Provides-Extra: modin-dask
Requires-Dist: modin; extra == "modin-dask"
Requires-Dist: dask[dataframe]; extra == "modin-dask"
Requires-Dist: distributed; extra == "modin-dask"
Provides-Extra: dask
Requires-Dist: dask[dataframe]; extra == "dask"
Requires-Dist: distributed; extra == "dask"
Provides-Extra: ibis
Requires-Dist: ibis-framework>=9.0.0; extra == "ibis"
Provides-Extra: polars
Requires-Dist: polars>=0.20.0; extra == "polars"
Provides-Extra: all
Requires-Dist: hypothesis>=6.92.7; extra == "all"
Requires-Dist: scipy; extra == "all"
Requires-Dist: pyyaml>=5.1; extra == "all"
Requires-Dist: black; extra == "all"
Requires-Dist: frictionless<=4.40.8; extra == "all"
Requires-Dist: pyspark[connect]<4.0.0,>=3.2.0; extra == "all"
Requires-Dist: modin; extra == "all"
Requires-Dist: ray; extra == "all"
Requires-Dist: dask[dataframe]; extra == "all"
Requires-Dist: distributed; extra == "all"
Requires-Dist: pandas-stubs; extra == "all"
Requires-Dist: fastapi; extra == "all"
Requires-Dist: geopandas<1.1.0; extra == "all"
Requires-Dist: shapely; extra == "all"
Requires-Dist: ibis-framework>=9.0.0; extra == "all"
Requires-Dist: polars>=0.20.0; extra == "all"
Dynamic: license-file

<br>
<div align="center"><a href="https://www.union.ai/pandera"><img src="docs/source/_static/pandera-banner.png" width="400"></a></div>

<h1 align="center">
  The Open-source Framework for Validating DataFrame-like Objects
</h1>

<p align="center">
  📊 🔎 ✅
</p>

<p align="center">
  <i>Data validation for scientists, engineers, and analysts seeking correctness.</i>
</p>

<br>


[![CI Build](https://img.shields.io/github/actions/workflow/status/unionai-oss/pandera/ci-tests.yml?branch=main&label=tests&style=for-the-badge)](https://github.com/unionai-oss/pandera/actions/workflows/ci-tests.yml?query=branch%3Amain)
[![Documentation Status](https://readthedocs.org/projects/pandera/badge/?version=stable&style=for-the-badge)](https://pandera.readthedocs.io/en/stable/?badge=stable)
[![PyPI version shields.io](https://img.shields.io/pypi/v/pandera.svg?style=for-the-badge)](https://pypi.org/project/pandera/)
[![PyPI license](https://img.shields.io/pypi/l/pandera.svg?style=for-the-badge)](https://pypi.python.org/pypi/)
[![pyOpenSci](https://go.union.ai/pandera-pyopensci-badge)](https://github.com/pyOpenSci/software-review/issues/12)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://img.shields.io/badge/repo%20status-Active-Green?style=for-the-badge)](https://www.repostatus.org/#active)
[![Documentation Status](https://readthedocs.org/projects/pandera/badge/?version=latest&style=for-the-badge)](https://pandera.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://img.shields.io/codecov/c/github/unionai-oss/pandera?style=for-the-badge)](https://codecov.io/gh/unionai-oss/pandera)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pandera.svg?style=for-the-badge)](https://pypi.python.org/pypi/pandera/)
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.3385265-blue?style=for-the-badge)](https://doi.org/10.5281/zenodo.3385265)
[![asv](http://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=for-the-badge)](https://pandera-dev.github.io/pandera-asv-logs/)
[![Total Downloads](https://img.shields.io/pepy/dt/pandera?style=for-the-badge&color=blue)](https://pepy.tech/project/pandera)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/pandera?style=for-the-badge)](https://anaconda.org/conda-forge/pandera)
[![Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack&logoColor=fff&style=for-the-badge)](https://flyte-org.slack.com/archives/C08FDTY2X3L)

Pandera is a [Union.ai](https://union.ai/blog-post/pandera-joins-union-ai) open
source project that provides a flexible and expressive API for performing data
validation on dataframe-like objects. The goal of Pandera is to make data
processing pipelines more readable and robust with statistically typed
dataframes.

## Install

Pandera supports [multiple dataframe libraries](https://pandera.readthedocs.io/en/stable/supported_libraries.html), including [pandas](http://pandas.pydata.org), [polars](https://docs.pola.rs/), [pyspark](https://spark.apache.org/docs/latest/api/python/index.html), and more. To validate `pandas` DataFrames, install Pandera with the `pandas` extra:

**With `pip`:**

```
pip install 'pandera[pandas]'
```

**With `uv`:**

```
uv pip install 'pandera[pandas]'
```

**With `conda`:**

```
conda install -c conda-forge pandera-pandas
```

## Get started

First, create a dataframe:

```python
import pandas as pd
import pandera.pandas as pa

# data to validate
df = pd.DataFrame({
    "column1": [1, 2, 3],
    "column2": [1.1, 1.2, 1.3],
    "column3": ["a", "b", "c"],
})
```

Validate the data using the object-based API:

```python
# define a schema
schema = pa.DataFrameSchema({
    "column1": pa.Column(int, pa.Check.ge(0)),
    "column2": pa.Column(float, pa.Check.lt(10)),
    "column3": pa.Column(
        str,
        [
            pa.Check.isin([*"abc"]),
            pa.Check(lambda series: series.str.len() == 1),
        ]
    ),
})

print(schema.validate(df))
#    column1  column2 column3
# 0        1      1.1       a
# 1        2      1.2       b
# 2        3      1.3       c
```

Or validate the data using the class-based API:

```python
# define a schema
class Schema(pa.DataFrameModel):
    column1: int = pa.Field(ge=0)
    column2: float = pa.Field(lt=10)
    column3: str = pa.Field(isin=[*"abc"])

    @pa.check("column3")
    def custom_check(cls, series: pd.Series) -> pd.Series:
        return series.str.len() == 1

print(Schema.validate(df))
#    column1  column2 column3
# 0        1      1.1       a
# 1        2      1.2       b
# 2        3      1.3       c
```


> [!WARNING]
> Pandera `v0.24.0` introduces the `pandera.pandas` module, which is now the
> (highly) recommended way of defining `DataFrameSchema`s and `DataFrameModel`s
> for `pandas` data structures like `DataFrame`s. Defining a dataframe schema from
> the top-level `pandera` module will produce a `FutureWarning`:
>
> ```python
> import pandera as pa
>
> schema = pa.DataFrameSchema({"col": pa.Column(str)})
> ```
>
> Update your import to:
>
> ```python
> import pandera.pandas as pa
> ```
>
> And all of the rest of your pandera code should work. Using the top-level
> `pandera` module to access `DataFrameSchema` and the other pandera classes
> or functions will be deprecated in version `0.29.0`


## Next steps

See the [official documentation](https://pandera.readthedocs.io) to learn more.
