CsvHelper.FastDynamic 1.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CsvHelper.FastDynamic --version 1.4.0
NuGet\Install-Package CsvHelper.FastDynamic -Version 1.4.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.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CsvHelper.FastDynamic --version 1.4.0
#r "nuget: CsvHelper.FastDynamic, 1.4.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.4.0

// Install CsvHelper.FastDynamic as a Cake Tool
#tool nuget:?package=CsvHelper.FastDynamic&version=1.4.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 record reader

BenchmarkDotNet=v0.13.2, OS=Windows 11 (10.0.22621.608)
AMD Ryzen 9 5950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK=6.0.401
  [Host]     : .NET 6.0.9 (6.0.922.41905), X64 RyuJIT AVX2
  DefaultJob : .NET 6.0.9 (6.0.922.41905), X64 RyuJIT AVX2


|               Method |     Mean |   Error |  StdDev | Ratio |    Gen0 |    Gen1 | Allocated | Alloc Ratio |
|--------------------- |---------:|--------:|--------:|------:|--------:|--------:|----------:|------------:|
|           GetRecords | 878.3 us | 3.62 us | 3.20 us |  1.00 | 31.2500 | 15.6250 | 510.84 KB |        1.00 |
| GetDictionaryRecords | 208.0 us | 0.85 us | 0.76 us |  0.24 | 21.7285 | 10.7422 | 355.03 KB |        0.69 |
|    GetDynamicRecords | 176.4 us | 1.07 us | 0.95 us |  0.20 | 14.4043 |  6.3477 | 237.26 KB |        0.46 |
|        GetRawRecords | 154.7 us | 1.08 us | 1.01 us |  0.18 | 13.1836 |  5.8594 | 218.98 KB |        0.43 |

Dynamic record writer

BenchmarkDotNet=v0.13.2, OS=Windows 11 (10.0.22621.608)
AMD Ryzen 9 5950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK=6.0.401
  [Host]     : .NET 6.0.9 (6.0.922.41905), X64 RyuJIT AVX2
  DefaultJob : .NET 6.0.9 (6.0.922.41905), X64 RyuJIT AVX2


|                            Method |     Mean |   Error |  StdDev | Ratio |    Gen0 |   Gen1 | Allocated | Alloc Ratio |
|---------------------------------- |---------:|--------:|--------:|------:|--------:|-------:|----------:|------------:|
|        WriteRecords_DynamicObject | 873.9 us | 2.82 us | 2.64 us |  1.00 | 55.6641 | 9.7656 | 914.53 KB |        1.00 |
| WriteDynamicRecords_DynamicObject | 498.9 us | 2.52 us | 2.36 us |  0.57 | 13.6719 | 2.4414 | 225.84 KB |        0.25 |

Thanks

License

This project is licensed under the Apache License 2.0

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 4,281 9/28/2023
1.5.0 998 9/4/2023
1.4.0 3,284 10/9/2022
1.3.1 26,066 3/4/2022
1.3.0 7,693 11/24/2021
1.2.0 3,788 2/21/2021
1.1.1 1,232 1/19/2021
1.1.0 710 1/19/2021
1.0.2 3,116 12/19/2020
1.0.1 1,288 9/28/2020
1.0.0 971 7/13/2020
1.0.0-preview1 779 6/8/2020