pandera.io.pandas_io.to_script¶
- pandera.io.pandas_io.to_script(dataframe_schema, path_or_buf=None, *, minimal=True, script_type='schema')[source]¶
Write a pandas-API schema or model to a Python script.
- Parameters:
dataframe_schema – schema to write to file or dump to string.
path_or_buf – filepath or buf stream to write to. If None, outputs string representation of the script.
minimal (
bool) – If True (default), omit constructor-default kwargs in the generatedColumn/DataFrameSchema/Fieldcalls.script_type (
Literal[‘schema’, ‘model’]) –"schema"emitsDataFrameSchema(default)."model"emits aDataFrameModelsubclass for the pandas API.
- Returns:
script string if
path_or_bufis None, otherwise None.