A high-performance, extensible CSV parsing library for .NET with support for synchronous and asynchronous reading.
TinyCsvParser is a CSV parsing library for .NET that provides high-performance, extensible, and easy-to-use tools for reading and processing CSV files. It solves the problem of efficiently parsing CSV data with support for complex scenarios like quoted fields, comments, and dynamic schemas, while minimizing memory allocations.
.NET developers who need to parse CSV files in applications, especially those dealing with large datasets, dynamic schemas, or requiring strict error handling and performance optimization.
Developers choose TinyCsvParser for its balance of performance (using spans and deferred execution), flexibility (header/index mapping, dynamic parsing), and comprehensive error handling, all within a stateless and reusable design.
Easy to use, easy to extend and high-performance library for CSV parsing with .NET
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages ReadOnlySpan<char> and deferred execution to minimize memory allocations, enabling efficient handling of large files as described in the asynchronous support sections.
Supports both header-based and index-based mapping with automatic quote handling, allowing adaptation to various CSV formats without code changes, as shown in the quick start examples.
Encapsulates every row outcome in CsvMappingResult<T> with distinct success, error, and comment states, ensuring no data loss and detailed debugging via LineNumber and RecordIndex.
Allows parsing directly into Dictionary<string, object?> or ExpandoObject for runtime flexibility, with fallback to string for unmapped columns to prevent data loss.
The migration guide from 2.x to 3.x highlights significant shifts, like moving from string[] to ref CsvRow, which can disrupt existing implementations and require code updates.
Requires defining mappings and options even for basic parsing, making it more cumbersome than simpler alternatives for straightforward CSV tasks.
CsvOptions only accepts a single character for delimiters, restricting use with files that employ multi-character separators, a common limitation not addressed in the README.