Skip to content

Excelhandler

flowtask.interfaces.ExcelHandler

ExcelHandler

append_data_to_excel

append_data_to_excel(df, file_path, sheet_name, start_row=None, start_col=1, include_header=False)

Append data from a DataFrame to an existing Excel file.

:param df: DataFrame containing data to append. :param file_path: Path to the Excel file. :param sheet_name: Name of the sheet to append data to. :param start_row: Starting row to append data (default is after last row). :param start_col: Starting column to append data. :param include_header: Whether to include the DataFrame's header.

create_excel_from_template

create_excel_from_template(template_path, new_file_path)

Create a new Excel file from a template.

:param template_path: Path to the Excel template. :param new_file_path: Path where the new Excel file will be saved.

create_new_excel_file

create_new_excel_file(file_path)

Create a new Excel file.

:param file_path: Path where the new Excel file will be saved.

edit_excel

edit_excel(file_path, edit_func)

Edit an existing Excel file using a provided function.

:param file_path: Path to the Excel file. :param edit_func: Function that takes a Workbook object and edits it.

pandas_to_excel

pandas_to_excel(df, file_path, **kwargs)

Save a pandas DataFrame to an Excel file.

:param df: DataFrame to save. :param file_path: Path to save the Excel file. :param kwargs: Additional keyword arguments for pandas' to_excel method.