Skip to content

Files

Implementation for a base class for file parsers.

FormatManager(file_path, schema=None)

Bases: ABC

Abstract class for FormatManager .

Initialize the FormatManager class. Args: file_path: the path to the file. schema: the schema of the file. Default is None. Returns: None

file_dir = os.path.dirname(file_path)

file_extension = os.path.splitext(file_path)[1]

file_name = os.path.basename(file_path)

file_path = file_path

schema = schema

create()

Create a file.

read(columns=None)

Read data from a file.

write(data)

Write data to a file.