Packages
Search packages... ⌘K
Go Package
csvimport
CSV import engine — batch parsing, validation, and typed row mapping
Go Ready MD
CSV Import Progress
$ result, err := csvimport.Import(file, &PropertyMapper{})
[csv] reading: properties-export.csv
[csv] columns: id, name, address, price, status
[csv] batch 1/4 — rows 1-250 parsed
[csv] batch 2/4 — rows 251-500 parsed
[csv] batch 3/4 — rows 501-750 parsed
[csv] batch 4/4 — rows 751-983 parsed
[csv] complete — 983 rows, 971 valid, 12 errors
[csv] errors: row 42 (price: negative), row 119 (status: unknown)...
About
Parses CSV files in configurable batch sizes with per-row validation and typed struct mapping. Reports progress, collects validation errors per row, and supports custom column-to-field mappers for non-standard CSV layouts.
Public API
| Name | Kind | Signature |
|---|---|---|
| Import | func | func Import[T any](r io.Reader, mapper RowMapper[T], opts ...Option) (*Result[T], error) |
| Reader | type | type Reader struct |
| RowMapper | interface | type RowMapper[T any] interface |
| ValidationError | type | type ValidationError struct |
Source
github.com/shredbx/sbx-core/pkg/csvimport
csvimportbatch-processingvalidation