For a library for parsing csv in Go, the first results are jszwec/csvutil (This library provides high-performance struct mapping, streaming support, and comprehensive read/write functionality for CSV data, making it a direct and feature-rich solution for Go developers), mitchellh/mapstructure (This library is a general-purpose tool for mapping generic maps to Go structs, but it lacks the specific CSV parsing, streaming, and delimiter-handling capabilities required for CSV processing) and spf13/cast (This library is a utility for converting between primitive Go types and does not provide the CSV parsing, streaming, or writing capabilities required for data processing). knadh/koanf and tidwall/gjson round out the shortlist. Compare the match explanations and check the project documentation against your requirements.
We curate open-source GitHub repositories matching “best go csv libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
csvutil provides fast and idiomatic mapping between CSV and Go (golang) values.
This library provides high-performance struct mapping, streaming support, and comprehensive read/write functionality for CSV data, making it a direct and feature-rich solution for Go developers.
mapstructure is a reflection-based library for the bidirectional encoding and decoding of generic map data into native typed Go structures. It functions as a tool for transforming loosely typed map values into specific structs and encoding those structs back into maps. The library utilizes Go reflection to map generic data keys to struct fields during runtime. It supports the transformation of untyped data from dynamic sources or configuration files into type-safe native structures. The mapping process includes recursive traversal of nested maps and slices, as well as the use of struct tags
This library is a general-purpose tool for mapping generic maps to Go structs, but it lacks the specific CSV parsing, streaming, and delimiter-handling capabilities required for CSV processing.
Cast is a Go type conversion library and data type casting utility designed to transform various primitive data types into specific target formats. It functions as a primitive type transformer that manages the conversion of basic Go types while handling incompatible data. The library provides mechanisms for dynamic type handling, allowing the system to process untyped or interface data and safely cast values into concrete types during runtime. It includes logic to distinguish between successful zero-value results and failed conversions through explicit error reporting and validation.
This library is a utility for converting between primitive Go types and does not provide the CSV parsing, streaming, or writing capabilities required for data processing.
koanf is a configuration management library for Go designed to load, merge, and unmarshal application settings from multiple sources into structured objects. It functions as a multi-source config loader that aggregates data from environment variables, files, and remote providers into a single unified map. The system utilizes a pluggable architecture for parsing and data abstraction, allowing it to transform bytes from formats such as JSON, YAML, and TOML into nested maps. It supports dynamic configuration watching to monitor external sources and trigger automatic reloads when settings change.
This is a configuration management library designed for loading and merging application settings, rather than a specialized tool for parsing and manipulating CSV data.
gjson is a Go JSON parser designed for schema-less reading and value extraction. It allows for the retrieval of specific data from JSON documents using dot-notation paths without requiring the definition of predefined Go structs. The library provides tools for path-based querying, including the use of wildcards and index-based queries to locate data within objects and arrays. It also functions as a JSON lines processor, treating multi-line documents as arrays to iterate and query individual entries. Additional capabilities include converting JSON values into native Go types such as strings,
This library is designed specifically for parsing and querying JSON data rather than handling CSV files, making it the wrong tool for your data processing requirements.
Polars is a high-performance columnar data processing library designed for efficient analytical workflows. It functions as a structured data library that organizes information into typed columns, utilizing the Apache Arrow memory format to enable zero-copy data sharing and cache-friendly, vectorized operations. The engine is built to handle large-scale tabular datasets, providing both local and distributed analytical runtimes that scale from single-machine environments to multi-node clusters. The project distinguishes itself through a sophisticated lazy query engine that constructs abstract e
Polars is a high-performance dataframe library for Rust rather than a Go-native CSV processing library, and while it handles tabular data, it is a heavy analytical engine rather than a specialized CSV parsing and writing tool for Go developers.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| jszwec/csvutil | 1K | Go | MIT | |
| mitchellh/mapstructure | 8K | Go | MIT | |
| spf13/cast | 4K | Go | MIT | |
| knadh/koanf | 3.9K | Go | mit | |
| tidwall/gjson | 15.5K | Go | MIT | |
| pola-rs/polars | 38.9K | Rust | MIT |