A wrapper library to read, manipulate and write data in xlsx and xlsm format
76
Load an Excel workbook and return sheet snapshots in workbook order while preserving native datetime and time values.
SheetSnapshot entries with matching names in the same order; "Data" rows equal [["item", "count"], ["apples", 3]] and "Empty" rows are an empty list rather than being dropped. @testdatetime value 2024-05-06 14:30:00 and a time value 09:15:30, returned rows keep those cells as datetime.datetime and datetime.time instances with the same values (not strings or numbers). @test@generates
from dataclasses import dataclass
from datetime import datetime, time
from typing import BinaryIO, List, Sequence, Union
@dataclass
class SheetSnapshot:
name: str
rows: List[Sequence[object]]
def read_workbook(source: Union[str, BinaryIO, bytes]) -> List[SheetSnapshot]:
"""
Read an XLSX/XLSM workbook from a filesystem path, bytes buffer, or open binary stream.
Preserves workbook sheet order and keeps datetime/time values as native Python objects.
Empty sheets are included with an empty rows list.
"""Provides Excel read/write support that preserves workbook sheet ordering and native datetime/time types when loading data.
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