CsvHelper.FastDynamic 1.5.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CsvHelper.FastDynamic --version 1.5.0                
NuGet\Install-Package CsvHelper.FastDynamic -Version 1.5.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CsvHelper.FastDynamic" Version="1.5.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CsvHelper.FastDynamic --version 1.5.0                
#r "nuget: CsvHelper.FastDynamic, 1.5.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CsvHelper.FastDynamic as a Cake Addin
#addin nuget:?package=CsvHelper.FastDynamic&version=1.5.0

// Install CsvHelper.FastDynamic as a Cake Tool
#tool nuget:?package=CsvHelper.FastDynamic&version=1.5.0                

CsvHelper.FastDynamic

Build Downloads NuGet License

Fast dynamic CSV records reader and writer extensions for CsvHelper

Installation

Install-Package CsvHelper.FastDynamic
dotnet add package CsvHelper.FastDynamic

Usage

Simple CSV Reader

using CsvHelper;
using CsvHelper.FastDynamic;

using var csvReader = new CsvReader(new StreamReader("sample.csv"), CultureInfo.InvariantCulture);

var records = csvReader.GetDynamicRecords();

foreach (var @record in records)
{
    Console.WriteLine(record);
}

Async CSV Enumerate (.NET Standard 2.1 / C# 8.0 or later)

using CsvHelper;
using CsvHelper.FastDynamic;

using var csvReader = new CsvReader(new StreamReader("sample.csv"), CultureInfo.InvariantCulture);

var records = csvReader.EnumerateDynamicRecordsAsync();

await foreach (var @record in records)
{
    Console.WriteLine(record);
}

Performance

Dynamic records reader

BenchmarkDotNet v0.13.7, Windows 11 (10.0.22621.2215/22H2/2022Update/SunValley2)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK 7.0.400
  [Host]     : .NET 7.0.10 (7.0.1023.36312), X64 RyuJIT AVX2
  DefaultJob : .NET 7.0.10 (7.0.1023.36312), X64 RyuJIT AVX2

|               Method |     Mean |   Error |  StdDev | Ratio |    Gen0 |    Gen1 | Allocated | Alloc Ratio |
|--------------------- |---------:|--------:|--------:|------:|--------:|--------:|----------:|------------:|
|           GetRecords | 684.3 μs | 3.24 μs | 3.03 μs |  1.00 | 31.2500 | 15.6250 | 510.87 KB |        1.00 |
| GetDictionaryRecords | 200.3 μs | 0.71 μs | 0.66 μs |  0.29 | 21.7285 | 21.4844 | 355.05 KB |        0.70 |
|    GetDynamicRecords | 163.7 μs | 0.91 μs | 0.85 μs |  0.24 | 14.4043 |  5.1270 | 237.28 KB |        0.46 |
|        GetRawRecords | 154.1 μs | 0.45 μs | 0.38 μs |  0.23 | 13.1836 |  5.1270 |    219 KB |        0.43 |

Dynamic records writer

BenchmarkDotNet v0.13.7, Windows 11 (10.0.22621.2215/22H2/2022Update/SunValley2)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK 7.0.400
  [Host]     : .NET 7.0.10 (7.0.1023.36312), X64 RyuJIT AVX2
  DefaultJob : .NET 7.0.10 (7.0.1023.36312), X64 RyuJIT AVX2

|                            Method |     Mean |   Error |  StdDev | Ratio |    Gen0 |    Gen1 | Allocated | Alloc Ratio |
|---------------------------------- |---------:|--------:|--------:|------:|--------:|--------:|----------:|------------:|
|        WriteRecords_DynamicObject | 670.2 μs | 4.27 μs | 3.99 μs |  1.00 | 55.6641 | 12.6953 | 914.65 KB |        1.00 |
| WriteDynamicRecords_DynamicObject | 414.1 μs | 1.93 μs | 1.80 μs |  0.62 | 13.6719 |  2.9297 | 225.95 KB |        0.25 |

Thanks

License

This project is licensed under the Apache License 2.0

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.1 16,832 9/28/2023
1.5.0 1,159 9/4/2023
1.4.0 3,946 10/9/2022
1.3.1 33,305 3/4/2022
1.3.0 7,803 11/24/2021
1.2.0 3,820 2/21/2021
1.1.1 1,261 1/19/2021
1.1.0 741 1/19/2021
1.0.2 3,149 12/19/2020
1.0.1 1,319 9/28/2020
1.0.0 1,006 7/13/2020
1.0.0-preview1 809 6/8/2020