A high-performance CSV ingestion and generation library for Ruby with C acceleration, designed for real-world data with intelligent defaults.
SmarterCSV is a high-performance CSV ingestion and generation library for Ruby that solves the silent data corruption issues of Ruby's built-in CSV library. It provides fast, robust parsing with intelligent defaults, returning Rails-ready hashes for seamless integration with ActiveRecord, Sidekiq, and data pipelines.
Ruby developers and teams working with CSV data imports, especially those using Rails, Sidekiq, or building data pipelines that handle messy, real-world user-uploaded files.
Developers choose SmarterCSV for its combination of raw speed (C-accelerated), robustness against common CSV pitfalls, and developer-friendly output that eliminates post-processing boilerplate, significantly reducing import time and code complexity.
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.
With C acceleration, it's up to 129× faster than CSV.table for end-to-end ingestion, including hash construction and conversions, as shown in benchmarks with real-world files.
Handles 8 out of 10 common CSV failure modes by default, such as duplicate headers and BOMs, preventing silent data corruption that plagues Ruby's built-in CSV.
Returns Rails-ready hashes with symbol keys out of the box, eliminating post-processing boilerplate for direct use with ActiveRecord, Sidekiq, and JSON workflows.
Supports chunked and streaming APIs for memory-efficient large file handling, plus bad row quarantine to collect errors without crashing entire imports.
Requires native compilation on MRI Ruby, which can fail on systems without build tools; while it falls back to Ruby, performance drops significantly.
With extensive transformation pipelines and over 30 options, it can be overwhelming for simple tasks, demanding careful tuning to avoid unintended data changes.
On JRuby and TruffleRuby, the library falls back to pure Ruby, missing the C acceleration and resulting in slower speeds compared to MRI.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.