ExcelToolkit

class ExcelToolkit(BaseToolkit):

A class representing a toolkit for extract detailed cell information from an Excel file.

This class provides methods extracting detailed content from Excel files (including .xls, .xlsx,.csv), and converting the data into Markdown formatted table.

init

def __init__(self, timeout: Optional[float] = None):

Initializes a new instance of the ExcelToolkit class.

Parameters:

  • timeout (Optional[float]): The timeout value for API requests in seconds. If None, no timeout is applied. (default: :obj:None)

_convert_to_markdown

def _convert_to_markdown(self, df: pd.DataFrame):

Convert DataFrame to Markdown format table.

Parameters:

  • df (pd.DataFrame): DataFrame containing the Excel data.

Returns:

str: Markdown formatted table.

extract_excel_content

def extract_excel_content(self, document_path: str):

Extract detailed cell information from an Excel file, including multiple sheets.

Parameters:

  • document_path (str): The path of the Excel file.

Returns:

str: Extracted excel information, including details of each sheet.

get_tools

def get_tools(self):

Returns:

List[FunctionTool]: A list of FunctionTool objects representing the functions in the toolkit.