RustyCSV - NimbleCSV-compatible CSV parsing and encoding with Rust NIFs

Hi all,

I’ve been working on RustyCSV, a CSV parser and encoder for Elixir backed by Rust NIFs. Version 0.4.0 is now available.

The goal is to provide a drop-in replacement for NimbleCSV 1.3.0 for both parsing and encoding. NimbleCSV is an excellent pure-Elixir option. RustyCSV is for people who are comfortable using a precompiled Rust NIF to get some additional performance on very large CSV files.

The usual NimbleCSV functions are supported, including parse_string/2, parse_stream/2, parse_enumerable/2, dump_to_iodata/2, and dump_to_stream/1.

The 0.4.0 release adds stricter CSV validation, compatible encoding return shapes, Rustler 0.38, and verification on Elixir 1.20 with OTP 29.

I also ran NimbleCSV 1.3.0’s upstream tests against RustyCSV. The behavior matches across all 21 tests. Exact error messages differ in four cases because RustyCSV reports byte offsets without including the original CSV content.

I’d appreciate feedback from anyone willing to try it

Hex: rusty_csv | Hex

Documentation: RustyCSV v0.4.0 — Documentation

3 Likes
Binary chunk streaming | ✅ arbitrary chunks | ❌ line-delimited only

That’s not a correct assessment. NimbleCSV can stream arbitrary chunks using to_line_stream/1 - an API even referenced later in the same README. You just need to explicitly opt into the overhead of handling such. No need to do that if e.g. you’re already reading a line stream from a file.

2 Likes

You’re right. I overlooked to_line_stream/1 when I wrote that comparison.

I’ve corrected the README. RustyCSV accepts arbitrary binary chunks directly through parse_stream/2; NimbleCSV supports them by passing the chunks through to_line_stream/1 first. Existing line-delimited streams can go straight to parse_stream/2 in both.

Thanks for catching that.

With respect, both your comments read like LLM-generated.

1 Like