Documentation
¶
Overview ¶
Package format dispatches tabular Reader construction by format identifier, sitting between the io/ interface definitions and the per-format leaf packages (io/csv, io/tsv, io/ndjson, io/jsonarray, io/parquet, io/arrow, io/excel). It exists as a sub-package of io/ to avoid an import cycle: io/csv (and siblings) already import io/ for the Reader / ResetReader interfaces, so the dispatch table cannot live in io/ itself.
Index ¶
Constants ¶
const ( CSV = "csv" TSV = "tsv" NDJSON = "ndjson" JSONArray = "jsonarray" Parquet = "parquet" Arrow = "arrow" Excel = "excel" Pulse = "pulse" )
Format identifiers for tabular sources Pulse can ingest. The empty string represents an unrecognised extension. "pulse" is reserved for the engine's native binary format — readers are not constructed for it; callers detect it and use it directly.
Variables ¶
SupportedImport lists every format NewReader accepts. Excludes "pulse" (native, no conversion needed) and the empty string. Order is stable for deterministic documentation and CLI help output.
Functions ¶
func FromExt ¶
FromExt returns the canonical format identifier for a file path based on its extension. Returns the empty string when the extension is not recognised — callers that need an error should wrap with their own diagnostic.
func NewReader ¶
NewReader constructs a tabular Reader for the given format, reading from path on fs. The returned Reader implements pio.ResetReader for every supported format, so schema inference + import is always available. Returns an error for the native pulse format (no tabular reader needed) and for unknown / empty formats.
Types ¶
type ReaderOptions ¶
type ReaderOptions struct {
Sheet string
}
ReaderOptions modulate reader construction. Currently only Excel honours Sheet; other formats ignore it silently.