CsvHelper.FastDynamic
1.5.1
dotnet add package CsvHelper.FastDynamic --version 1.5.1
NuGet\Install-Package CsvHelper.FastDynamic -Version 1.5.1
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.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CsvHelper.FastDynamic --version 1.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CsvHelper.FastDynamic, 1.5.1"
#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.1 // Install CsvHelper.FastDynamic as a Cake Tool #tool nuget:?package=CsvHelper.FastDynamic&version=1.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CsvHelper.FastDynamic
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.2361/22H2/2022Update/SunValley2)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK 7.0.401
[Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2
DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2
| Method | Mean | Error | StdDev | Ratio | Gen0 | Gen1 | Allocated | Alloc Ratio |
|--------------------- |---------:|--------:|--------:|------:|--------:|--------:|----------:|------------:|
| GetRecords | 679.9 μs | 2.30 μs | 2.04 μs | 1.00 | 31.2500 | 15.6250 | 510.87 KB | 1.00 |
| GetDictionaryRecords | 217.2 μs | 0.26 μs | 0.21 μs | 0.32 | 21.7285 | 21.4844 | 355.05 KB | 0.70 |
| GetDynamicRecords | 159.6 μs | 1.12 μs | 1.04 μs | 0.23 | 14.4043 | 4.6387 | 237.29 KB | 0.46 |
| GetRawRecords | 152.9 μs | 0.84 μs | 0.74 μs | 0.22 | 13.1836 | 5.1270 | 219 KB | 0.43 |
Dynamic records writer
BenchmarkDotNet v0.13.7, Windows 11 (10.0.22621.2361/22H2/2022Update/SunValley2)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK 7.0.401
[Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2
DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2
| Method | Mean | Error | StdDev | Ratio | Gen0 | Gen1 | Allocated | Alloc Ratio |
|---------------------------------- |---------:|--------:|--------:|------:|--------:|--------:|----------:|------------:|
| WriteRecords_DynamicObject | 659.9 μs | 1.74 μs | 1.54 μs | 1.00 | 55.6641 | 12.6953 | 914.65 KB | 1.00 |
| WriteDynamicRecords_DynamicObject | 391.7 μs | 1.78 μs | 1.66 μs | 0.59 | 13.6719 | 2.9297 | 225.95 KB | 0.25 |
Thanks
License
This project is licensed under the Apache License 2.0
Product | Versions 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.
-
net6.0
- CsvHelper (>= 30.0.1)
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 | 15,297 | 9/28/2023 |
1.5.0 | 1,155 | 9/4/2023 |
1.4.0 | 3,837 | 10/9/2022 |
1.3.1 | 33,024 | 3/4/2022 |
1.3.0 | 7,799 | 11/24/2021 |
1.2.0 | 3,816 | 2/21/2021 |
1.1.1 | 1,257 | 1/19/2021 |
1.1.0 | 735 | 1/19/2021 |
1.0.2 | 3,145 | 12/19/2020 |
1.0.1 | 1,315 | 9/28/2020 |
1.0.0 | 1,002 | 7/13/2020 |
1.0.0-preview1 | 807 | 6/8/2020 |