finds.dev← search

// the find

tilo/smarter_csv

★ 1,546 · Ruby · MIT · updated Jun 2026

Fastest end-to-end CSV ingestion for Ruby (with C acceleration). SmarterCSV auto-detects formats, applies smart defaults, and returns Rails-ready hashes for seamless use with ActiveRecord, Sidekiq, parallel jobs, and S3 pipelines — even for messy user-uploaded real-world data.

SmarterCSV is a Ruby CSV parsing library with a C extension that returns symbol-keyed hashes instead of raw arrays, handling the encoding/BOM/whitespace/duplicate-header edge cases that Ruby's built-in CSV silently botches. It's aimed at Rails developers doing bulk imports — think ActiveRecord batch inserts and Sidekiq pipelines — where you want the data ready to use without a post-processing layer.

The C extension delivers real-world gains (4.9×–132× vs CSV.table in their benchmarks) on full hash-producing pipelines, not just tokenizer microbenchmarks — the README is honest about this distinction. Streaming from non-seekable IO (GzipReader, STDIN, HTTP response bodies) without materializing to disk is genuinely useful for S3/cloud pipelines. Bad row quarantine with on_bad_row: :collect lets you finish the import and audit failures separately, which is what you actually want in production. The header/value transformation pipelines are clearly documented step-by-step, so you know exactly what order things run and which step to hook into.

The C extension means native compilation at install time — JRuby and TruffleRuby fall back to pure Ruby, which negates the headline performance numbers for shops running on those runtimes. The benchmarks are self-reported and the ZSV comparison footnote quietly concedes ZSV raw arrays are 2×–14× faster when you remove the post-processing work SmarterCSV includes — reasonable framing, but worth knowing if you control the full pipeline and don't need hashes. Write support (generate) is new and thin: no append mode, no streaming writes for large exports, and the API surface is much smaller than the read side. At 1546 stars for a library that's been around since Rails 3 days, adoption is surprisingly modest — this is a well-maintained niche tool, not an ecosystem standard, so expect limited third-party integrations and Stack Overflow answers.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →