Table of Contents

Namespace ExcelReader.Core.Reader

Classes

Excel

Entry point for opening Excel and CSV workbooks. Open(string, ExcelReaderOptions?)/ Open(Stream, bool, ExcelReaderOptions?) and their async counterparts auto-detect XLSX/XLSB/XLS from the file's signature and return a format-agnostic IExcelWorkbook; the From*/FromXls*/FromXlsb*/FromCsv* methods open a specific, known format directly.

ExcelEncryptionException

Thrown when an encrypted workbook cannot be opened. Inspect Reason to decide what to do: only PasswordRequired and PasswordIncorrect are worth prompting a user about — the other two are terminal, and retrying with another password will never help.

ExcelLimitExceededException

Thrown when reading a workbook would exceed one of the resource limits configured on ExcelReaderOptions (e.g. decompressed size, a single cell's byte length, shared-string table size, or ZIP entry count), guarding against maliciously or accidentally oversized files.

ExcelPassword

A workbook password. Deliberately a class rather than a record: a record's synthesized ToString would print the password, and this type is held by ExcelReaderOptions, which is a record — so one logger.LogDebug("{Options}", options) would leak it. ToString() below is what makes that safe.

ExcelReaderOptions

Resource limits and behavior toggles applied when opening and reading a workbook or a CSV source. Exceeding a byte or entry-count limit throws ExcelLimitExceededException.

ExcelSheetList<TSheet>

The sheets of a workbook, in workbook order. Indexing or enumerating the list opens nothing.

ExcelTable

An Excel table (a range formatted with "Format as Table", stored as a ListObject): its name, its position on its sheet and its columns.

RowAggregation<TState>

A fold over rows expressed as three functions, for AggregateAsync<TState>(IExcelSheet, RowAggregation<TState>, SheetParallelOptions?, CancellationToken). Carries the same contract as IRowAccumulator<TSelf, TModel>, without requiring a type.

SheetDataReader

Adapts one IExcelSheet to IDataReader, so it can feed SqlBulkCopy, DataTable.Load, Dapper, or any other ADO.NET consumer directly.

SheetDataReaderOptions

Options for adapting a sheet to IDataReader with SheetDataReader.

SheetParallel

Reads a sheet of any format across several threads: ParseAsync yields typed rows in source order, ForEachAsync hands each row to a callback on the worker threads, and AggregateAsync folds rows into one accumulator per partition.

SheetParallelOptions

Options for reading a sheet across several threads with SheetParallel.

Structs

Cell

A single worksheet cell's value, exposed as a zero-allocation view over the reader's underlying buffers. Only valid for the lifetime of the row it was read from — do not store it past that point.

Row

A single worksheet row, exposed as a zero-allocation view over the reader's underlying buffers. Only valid for the lifetime of the enumeration that produced it — do not store it past that point.

RowCell

A cell paired with its column index, as produced by RowCellEnumerator.

RowCellEnumerator

Enumerates the populated cells of a Row, in ascending column order, skipping gaps. Supports foreach via the duck-typed enumerator pattern (ref structs cannot implement IEnumerator<T>).

Interfaces

IExcelRowEnumerator

A forward-only cursor over a sheet's rows, implemented by every concrete format's row enumerator and driven either synchronously (MoveNext()) or asynchronously (MoveNextAsync()).

IExcelSheet

A sheet of an IExcelWorkbook: its position, name and visibility, and its rows.

IExcelSheet<TEnumerator>

One sheet's rows, typed to the concrete enumerator it hands out (TEnumerator) so callers read without boxing to IExcelRowEnumerator.

IExcelWorkbook

An open workbook of any supported format (XLSX, XLSB, XLS, CSV): its sheets and the state they share. Sheets are obtained from it and read independently.

IRowAccumulator<TSelf, TModel>

Folds typed rows read by SheetParallel.AggregateAsync into a result. Each partition of the sheet gets its own instance.

IRowRecord<TSelf>

A typed row that parses itself from a Row, for AggregateAsync<TAccumulator, TRecord>(IExcelSheet, SheetParallelOptions?, CancellationToken).

Enums

CellType

Identifies the kind of value a Cell holds.

ExcelEncryptionReason

Why an encrypted workbook could not be opened.

ExcelFileFormat

Identifies the on-disk Excel file format a workbook was read from or is to be written as.

Delegates

RowAction<TState>

Processes one row into the state owned by the partition that read it.