Skip to content

Save & Load

to_excel

to_excel(
    dfs: Sequence[tuple[ExcelFrame, tuple[int, int]]],
    path: Path,
    *,
    index_path: Path | None = None,
    sheet_styler: SheetStyler | None = None,
) -> None

Writes possibly more than one ExcelFrames to an excel file to a given path. Specify index_path to write down the location index of the ExcelFrames to use it for loading them from the .xlsx file in the future.

Parameters:

Name Type Description Default
dfs Sequence[tuple[ExcelFrame, tuple[int, int]]]

Sequence of ExcelFrames and its starting positions, zero-indexed.

required
path Path

Path of an .xlsx file

required
index_path Path | None

Path of an index JSON file

None

of_excel

of_excel(*, path: Path | str, index_path: Path | str) -> Sequence[ExcelFrame]

Loads possibly more than one ExcelFrames from an .xlsx file from a given path and index_path.

Parameters:

Name Type Description Default
path Path | str

.xlsx file Path to load from

required
index_path Path | str

Index JSON file path that specifies the location of the df's to load.

required

Returns:

Type Description
Sequence[ExcelFrame]

A sequence of ExcelFrame, ordered based on the index path.

of_csv

of_csv(path: Path | str) -> ExcelFrame

Loads an ExcelFrame from a csv file.

Parameters:

Name Type Description Default
path Path | str

CSV file path

required

Returns:

Type Description
ExcelFrame

An ExcelFrame