A wrapper library to read, manipulate and write data in xlsx and xlsm format
76
Build a small utility that reads an Excel worksheet and returns only the visible cell values, omitting any hidden rows and columns. Output order must match the order of visible rows and columns in the sheet.
[["Name", "Score"], ["Bob", 88]] when the visible cells contain a header row ["Name", "Score"] and a visible data row ["Bob", 88]; the hidden ID column and the hidden second row are not included. @test["Item", "Code", "Qty"] with column B hidden), the returned grid must exclude the hidden column entirely while keeping row order, producing [["Item", "Qty"], ["Pencil", 12], ["Book", 5]] for the corresponding visible cells. @test[["Name", "Score"], ["Bob", 88]], confirming hidden content is skipped even when reading from bytes. @test@generates
from typing import Any, List, Optional, Union, BinaryIO
def extract_visible_cells(source: Union[str, BinaryIO], sheet_name: Optional[str] = None) -> List[List[Any]]:
"""
Read a worksheet and return a matrix of visible cell values only, omitting hidden rows and columns.
- source: path to the workbook or a binary file-like object positioned at the start.
- sheet_name: optional sheet to read; defaults to the first sheet when not provided.
"""Skip-aware Excel reader for loading visible worksheet content.
Install with Tessl CLI
npx tessl i tessl/pypi-pyexcel-xlsxdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10