ToucanToco / fastexcel

A Python wrapper around calamine
http://fastexcel.toucantoco.dev/
MIT License
121 stars 6 forks source link

feat: support callable in use_columns parameter #240

Closed julio-34727 closed 4 months ago

julio-34727 commented 5 months ago

Hi,

Is it possible to support a callable in the use_columns parameter like in pandas.read_excel.

def load_sheet_by_name(
    self,
    name: str,
    *,
    header_row: int | None = 0,
    column_names: list[str] | None = None,
    skip_rows: int = 0,
    n_rows: int | None = None,
    schema_sample_rows: int | None = 1000,
    use_columns: list[str] | list[int] | str | Callable[[str], bool] | None = None,
        dtypes: 'DTypeMap | None' = None
) -> ExcelSheet: ...