Skip to content

API Reference parrot_tools.excel

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.excel

View source

MS Excel Tool migrated to use AbstractDocumentTool framework.

Alias AbstractDocumentTool

Re-exported from parrot_tools.document.AbstractDocumentTool.

Class DataFrameToExcelTool

Simplified Excel tool that focuses purely on DataFrame export.

This is a convenience wrapper around ExcelTool for users who primarily need to export DataFrames without complex document features.

Method DataFrameToExcelTool.quick_export

Quick export method that returns just the file path.

quick_export(data: Union[pd.DataFrame, List[Dict], str], filename: Optional[str] = None, format: Literal['excel', 'ods'] = 'excel') -> str

Parameter Type Default Description
data Union[pd.DataFrame, List[Dict], str] Data to export (DataFrame, list of dicts, or JSON string)
filename Optional[str] None Optional filename
format Literal['excel', 'ods'] 'excel' Export format

Returns: str — Path to the created file

Alias DocumentGenerationArgs

Re-exported from parrot_tools.document.DocumentGenerationArgs.

Class ExcelArgs

Arguments schema for Excel/ODS Document generation.

Attributes:

Attribute Type Description
content Union[pd.DataFrame, List[Dict[str, Any]]]
sheet_name str
template_file Optional[str]
output_format Literal['excel', 'ods']
header_styles Optional[Dict[str, Any]]
data_styles Optional[Dict[str, Any]]
auto_adjust_columns bool
freeze_header bool

Method ExcelArgs.validate_template_file

validate_template_file(v)

Parameter Type Default Description
v

Method ExcelArgs.validate_content

validate_content(v)

Parameter Type Default Description
v

Method ExcelArgs.validate_sheet_name

validate_sheet_name(v)

Parameter Type Default Description
v

Class ExcelTool

Microsoft Excel/OpenDocument Spreadsheet Generation Tool.

This tool exports pandas DataFrames to Excel (.xlsx) or OpenDocument (.ods) files with support for custom styling, templates, and advanced formatting features.

Features:

  • Export DataFrames to Excel or ODS formats
  • Custom header and data cell styling
  • Template support for both formats
  • Auto-adjusting column widths
  • Header row freezing
  • Professional spreadsheet formatting
  • Comprehensive error handling and validation
Parameter Type Default Description
templates_dir Optional[Path] None Directory containing Excel/ODS templates
default_format Literal['excel', 'ods'] 'excel' Default output format ('excel' or 'ods')
artifact_store Any None Server-managed artifact store (exports are published there when set)
**kwargs {} Additional arguments for AbstractDocumentTool

Method ExcelTool.export_dataframe

Convenience method to directly export a DataFrame.

export_dataframe(dataframe: pd.DataFrame, output_format: Literal['excel', 'ods'] = 'excel', **kwargs) -> Dict[str, Any]

Parameter Type Default Description
dataframe pd.DataFrame DataFrame to export
output_format Literal['excel', 'ods'] 'excel' Export format
**kwargs {} Additional arguments for _execute

Returns: Dict[str, Any] — Dictionary with export results

Method ExcelTool.export_data

Convenience method to export various data formats.

export_data(data: Union[List[Dict], pd.DataFrame, str], output_format: Literal['excel', 'ods'] = 'excel', **kwargs) -> Dict[str, Any]

Parameter Type Default Description
data Union[List[Dict], pd.DataFrame, str] Data to export (DataFrame, list of dicts, or JSON string)
output_format Literal['excel', 'ods'] 'excel' Export format
**kwargs {} Additional arguments for _execute

Returns: Dict[str, Any] — Dictionary with export results

Method ExcelTool.get_format_info

Get information about supported formats.

get_format_info() -> Dict[str, Any]

Returns: Dict[str, Any]

Alias safe_template_name

Re-exported from parrot_tools._exports.safe_template_name.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally