{"id":25902529,"url":"https://github.com/jitbit/csvexport","last_synced_at":"2026-04-25T13:19:18.512Z","repository":{"id":26633820,"uuid":"30089584","full_name":"jitbit/CsvExport","owner":"jitbit","description":"Very simple CSV-export tool for C#","archived":false,"fork":false,"pushed_at":"2025-03-05T01:20:55.000Z","size":82,"stargazers_count":172,"open_issues_count":2,"forks_count":64,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-15T07:03:25.968Z","etag":null,"topics":["c-sharp","csv","csv-export","dotnet"],"latest_commit_sha":null,"homepage":"https://www.jitbit.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jitbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-30T20:32:34.000Z","updated_at":"2025-03-27T12:17:12.000Z","dependencies_parsed_at":"2023-01-14T05:04:00.179Z","dependency_job_id":"d1a0f53f-a997-4647-a458-1d66f6ad12fc","html_url":"https://github.com/jitbit/CsvExport","commit_stats":{"total_commits":67,"total_committers":10,"mean_commits":6.7,"dds":0.5970149253731343,"last_synced_commit":"97ca10807a0a23546add7a3f9eb4c179eb61b83f"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitbit%2FCsvExport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitbit%2FCsvExport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitbit%2FCsvExport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitbit%2FCsvExport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jitbit","download_url":"https://codeload.github.com/jitbit/CsvExport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254291961,"owners_count":22046424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","csv","csv-export","dotnet"],"created_at":"2025-03-03T03:16:40.022Z","updated_at":"2026-04-25T13:19:18.502Z","avatar_url":"https://github.com/jitbit.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CsvExport\nA very simple and very fast CSV-export tool for C#.\n\n[![.NET](https://github.com/jitbit/CsvExport/actions/workflows/dotnet.yml/badge.svg)](https://github.com/jitbit/CsvExport/actions/workflows/dotnet.yml)\n\n## V3 Breaking changes:\n\n- .NET 8 targeting (use v2 for .NET Framework, we'll backport critical fixes)\n- Uses `char` instead of `string` for column separator\n\n## Features\n\n1. 33 times faster than CsvHelper\n1. 3X less memory usage\n1. Streaming support (CSV writer does not buffer large CSVs in memory)\n1. Excel-compatible export (separator detected automatically, friendly-trimming rows and values for compatibility)\n2. Escapes commas, quotes, multiline text\n3. Exports dates in timezone-proof format\n4. Extremely easy to use\n6. 4-times less memory usage\n\n## Benchmarks\n\n|                   Method |      Mean |      Error |    StdDev |   Gen0 |   Gen1 | Allocated |\n|------------------------- |----------:|-----------:|----------:|-------:|-------:|----------:|\n| 😟             CsvHelper | 372.90 us | 390.842 us | 21.423 us | 9.7656 | 4.8828 |   85.4 KB |\n| ✅      CsvExport_Manual |  12.71 us |   1.040 us |  0.057 us | 3.5858 | 0.1984 |  29.35 KB |\n| ✅ CsvExport_GenericType |  13.22 us |   1.240 us |  0.068 us | 3.5858 | 0.2289 |  29.39 KB |\n\nThis benchmark is generating a 100-line CSV file with 4 columns. Check the \"SpeedBenchmarks\" code.\n\n## Usage examples:\n\nInstall via Nuget `Install-Package CsvExport`\n\nFor \"manual\" CSV ad-hoc generation use this:\n\n```c#\nvar myExport = new CsvExport();\n\nmyExport.AddRow();\nmyExport[\"Region\"] = \"Los Angeles, USA\";\nmyExport[\"Sales\"] = 100000;\nmyExport[\"Date Opened\"] = new DateTime(2003, 12, 31);\n\nmyExport.AddRow();\nmyExport[\"Region\"] = \"Canberra \\\"in\\\" Australia\";\nmyExport[\"Sales\"] = 50000;\nmyExport[\"Date Opened\"] = new DateTime(2005, 1, 1, 9, 30, 0);\n\n//save as file\nmyExport.ExportToFile(\"results.csv\");\n```\n\nFor generating CSV out of a typed `List\u003cT\u003e` of objects:\n\n```c#\n\npublic class Foo\n{\n\tpublic string Region { get; set; }\n\tpublic int Sales { get; set; }\n\tpublic DateTime DateOpened { get; set; }\n}\n\nvar list = new List\u003cFoo\u003e\n{\n\tnew Foo { Region = \"Los Angeles\", Sales = 123321, DateOpened = DateTime.Now },\n\tnew Foo { Region = \"Canberra in Australia\", Sales = 123321, DateOpened = DateTime.Now },\n};\n\nvar myExport = new CsvExport();\nmyExport.AddRows(list);\nstring csv = myExport.Export();\n```\nConfiguring is done via constructor parameters:\n\n```c#\nvar myExport = new CsvExport(\n\tcolumnSeparator: ',',\n\tincludeColumnSeparatorDefinitionPreamble: true, //Excel wants this in CSV files\n\tincludeHeaderRow: true\n);\n```\n\nAlso, methods `ExportToFile` and `WriteToStream` and `ExportToBytes` offer an optional encoding parameter.\n\n### Using with ASP.NET Core:\n\nFor big CSV files (megabytes) use `WriteToStreamAsync` and write to `Response.Body` directly. This is very important to save memory usage. Here's a handy heper class:\n\n```c#\npublic class CsvExportResult(Csv.CsvExport csv, string fileName) : ActionResult\n{\n\tpublic override Task ExecuteResultAsync(ActionContext ctx)\n\t{\n\t\tvar res = ctx.HttpContext.Response;\n\t\tres.ContentType = \"text/csv\";\n\t\tres.Headers.ContentDisposition = $\"attachment; filename=\\\"{fileName}\\\"\";\n\t\treturn csv.WriteToStreamAsync(res.Body, cancellationToken: ctx.HttpContext.RequestAborted);\n\t}\n}\n\n//usage in MVC action\nreturn new CsvExportResult(csvExport, \"filename.csv\");\n```\n\n### License\n\nThe code is licensed under *[MIT License](/LICENSE)*.\n\nSucessfully tested for years in production with our [Jitbit Helpdesk Ticketing System](https://www.jitbit.com/helpdesk/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjitbit%2Fcsvexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjitbit%2Fcsvexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjitbit%2Fcsvexport/lists"}