pandera.typing.fastapi.UploadFile

class pandera.typing.fastapi.UploadFile(data, filename, file, *args, **kwargs)[source]

Pandera-specific subclass of fastapi.UploadFile.

This type uses pandera.typing.DataFrame to read files into dataframe format based on the pandera.api.pandas.models.DataFrameModel configuration.

Initialize UploadFile object that has a data property that contains validated data.

Parameters:

data (Any) – pandera-validated data

Filename:

name of file©

File:

a file-like object

Attributes

content_type

file

filename

size

headers

Methods

__init__(data, filename, file, *args, **kwargs)[source]

Initialize UploadFile object that has a data property that contains validated data.

Parameters:

data (Any) – pandera-validated data

Filename:

name of file©

File:

a file-like object

classmethod pydantic_validate_v2(obj, dataframe_type)[source]

Pydantic validation method for validating dataframes in the context of a file upload.

Return type:

Any