tessl install tessl/pypi-pyexcel-xlsx@0.6.0A wrapper library to read, manipulate and write data in xlsx and xlsm format
Agent Success
Agent success rate when using this tile
76%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.38x
Baseline
Agent success rate without this tile
55%
Create a utility that reads an Excel workbook (.xlsx/.xlsm) and emits a new summary workbook listing sheet names with their non-empty row counts. Count a row only when it has at least one non-empty cell; completely empty sheets yield a count of 0. The generated workbook must contain a single sheet named SheetSummary with a header row ["sheet_name", "row_count"], followed by one row per included sheet in the original order.
include_hidden is true, include hidden sheets in the summary with their non-empty row counts, preserving the workbook's sheet order @testBytesIO) for .xlsx or .xlsm content and write the summary workbook to a provided binary stream so the summary can be reloaded from that stream @test@generates
from typing import BinaryIO, Dict, List, Union
def summarize_workbook(
source: Union[str, bytes, BinaryIO],
destination: Union[str, BinaryIO],
include_hidden: bool = False,
) -> List[Dict[str, Union[str, int]]]:
"""
Load an Excel workbook from a file path, bytes, or binary stream,
build a summary of sheet names and non-empty row counts in original sheet order,
write that summary to a new workbook with a single sheet named 'SheetSummary',
and return the summary data as a list of dictionaries.
"""Provides Excel read/write support for .xlsx and .xlsm files.