API Reference

The io module and built-in Hypothesis checks require a pandera installation with the corresponding extension, see the installation instructions for more details.

Schemas

pandera.schemas.DataFrameSchema

A light-weight pandas DataFrame validator.

pandera.schemas.SeriesSchema

Series validator.

Schema Components

pandera.schema_components.Column

Validate types and properties of DataFrame columns.

pandera.schema_components.Index

Validate types and properties of a DataFrame Index.

pandera.schema_components.MultiIndex

Validate types and properties of a DataFrame MultiIndex.

Schema Models

pandera.model.SchemaModel

Definition of a DataFrameSchema.

Model Components

pandera.model_components.Field

Used to provide extra information about a field of a SchemaModel.

pandera.model_components.check

Decorator to make SchemaModel method a column/index check function.

pandera.model_components.dataframe_check

Decorator to make SchemaModel method a dataframe-wide check function.

Typing

pandera.typing

Typing definitions and helpers.

Config

pandera.model.BaseConfig

Define DataFrameSchema-wide options.

Checks

pandera.checks.Check

Check a pandas Series or DataFrame for certain properties.

pandera.hypotheses.Hypothesis

Special type of Check that defines hypothesis tests on data.

Pandas Data Types

pandera.dtypes.PandasDtype

Enumerate all valid pandas data types.

Decorators

pandera.decorators.check_input

Validate function argument when function is called.

pandera.decorators.check_output

Validate function output.

pandera.decorators.check_io

Check schema for multiple inputs and outputs.

pandera.decorators.check_types

Validate function inputs and output based on type annotations.

Schema Inference

pandera.schema_inference.infer_schema

Infer schema for pandas DataFrame or Series object.

IO Utils

pandera.io.from_yaml

Create DataFrameSchema from yaml file.

pandera.io.to_yaml

Write DataFrameSchema to yaml file.

pandera.io.to_script

Write DataFrameSchema to a python script.

Data Synthesis Strategies

pandera.strategies

Generate synthetic data from a schema definition.

Extensions

pandera.extensions

pandera API extensions

Errors

pandera.errors.SchemaError

Raised when object does not pass schema validation constraints.

pandera.errors.SchemaErrors

Raised when multiple schema are lazily collected into one error.

pandera.errors.SchemaInitError

Raised when schema initialization fails.

pandera.errors.SchemaDefinitionError

Raised when schema definition is invalid on object validation.