A fast, idiomatic, and dependency-free Go library for mapping between CSV and Go values.
csvutil is a Go package that provides efficient and intuitive mapping between CSV data and Go structs. It is not a CSV parser itself but works with any CSV reader or writer implementing standard interfaces, such as Go's built-in encoding/csv package, offering flexibility and high performance.
Go developers who need to serialize and deserialize CSV data to and from Go structs, particularly those working with large datasets, custom CSV formats, or requiring high-performance data processing.
Developers choose csvutil for its dependency-free design, idiomatic Go API, and superior performance compared to alternatives like gocsv and easycsv, while offering advanced features like streaming support, custom type handling, and data normalization.
csvutil provides fast and idiomatic mapping between CSV and Go (golang) values.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks in the README show csvutil outperforms alternatives like gocsv and easycsv in both unmarshal and marshal operations, with lower memory allocation and faster execution times.
The library has no external dependencies, keeping it lightweight and easy to integrate into Go projects without bloating the dependency tree.
It works with any CSV reader or writer via standard Go interfaces, such as encoding/csv, allowing for custom implementations and compatibility with various CSV formats like TSV.
Supports custom types, struct tags, time formats, and data normalization through Decoder.Map, enabling fine-grained control over CSV data handling.
The README explicitly states there is no default encoding/decoding for slice and map fields, requiring users to implement custom Marshaler/Unmarshaler interfaces for these types.
For basic CSV operations without struct mapping, using csvutil adds unnecessary complexity compared to Go's standard csv package, as it mandates defining Go structs with tags.
Handling custom types or overrides involves multiple steps, such as implementing interfaces or using Register functions, which can be verbose and error-prone for simple use cases.