A simple and fast CSV parsing and dumping library for Elixir
open sourceApache-2.0free
NimbleCSV is Dashbit's CSV parsing and dumping library for Elixir. It gets its speed from letting you define your own parser and dumper, with the separator and escape you choose, compiled to binary patterns. It parses eagerly or lazily as a stream and writes CSV back out, and ships NimbleCSV.RFC4180 for ordinary comma-separated files. It leaves casting values and handling headers to your own code on top of the parsed rows.
Problems it solves
- parse a large CSV file in Elixir without loading it all into memory
- read tab-separated files fast in my Phoenix app
- export query results to CSV from Elixir
Features
- custom parsers and dumpers with your own separator and escape
- eager and lazy (streaming) parsing
- CSV dumping
- NimbleCSV.RFC4180 built in for comma-separated files
Limitations
- It doesn't cast values or manage headers: you build that on the parsed rows1
