Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Ruby
  3. smarter_csv

smarter_csv

MITRuby

A high-performance CSV ingestion and generation library for Ruby with C acceleration, designed for real-world data with intelligent defaults.

GitHubGitHub
1.5k stars192 forks0 contributors

What is smarter_csv?

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.

Target Audience

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.

Value Proposition

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.

Overview

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.

Use Cases

Best For

  • Importing large CSV files into Rails applications with ActiveRecord
  • Building resilient data pipelines that handle messy, user-uploaded CSV
  • Processing CSV in parallel with Sidekiq or other background job systems
  • Reducing CSV import times from hours to minutes with C acceleration
  • Quarantining bad rows instead of crashing entire CSV imports
  • Streaming or chunking massive CSV files to minimize memory usage

Not Ideal For

  • Projects on JRuby or TruffleRuby where maximum parsing speed is critical, as the C acceleration is unavailable
  • Simple, one-off CSV parsing scripts where Ruby's built-in CSV library suffices and adding a gem dependency is unnecessary
  • Applications requiring raw, unmodified CSV data without automatic transformations like whitespace stripping or numeric conversion

Pros & Cons

Pros

Blazing Fast Performance

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.

Robust Error Handling

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.

Developer-Friendly Output

Returns Rails-ready hashes with symbol keys out of the box, eliminating post-processing boilerplate for direct use with ActiveRecord, Sidekiq, and JSON workflows.

Advanced Processing Features

Supports chunked and streaming APIs for memory-efficient large file handling, plus bad row quarantine to collect errors without crashing entire imports.

Cons

C Extension Dependency

Requires native compilation on MRI Ruby, which can fail on systems without build tools; while it falls back to Ruby, performance drops significantly.

Configuration Overhead

With extensive transformation pipelines and over 30 options, it can be overwhelming for simple tasks, demanding careful tuning to avoid unintended data changes.

Limited Performance on Alternative Rubies

On JRuby and TruffleRuby, the library falls back to pure Ruby, missing the C acceleration and resulting in slower speeds compared to MRI.

Frequently Asked Questions

Quick Stats

Stars1,518
Forks192
Contributors0
Open Issues0
Last commit1 day ago
CreatedSince 2012

Tags

#sidekiq#batch-processing#ruby-gem#csv-parsing#csv#active-record#rails-integration#data-ingestion#data-pipeline#c-extension#csv-parser#performance

Built With

R
Ruby
C
C++

Included in

Ruby14.1k
Auto-fetched 1 day ago

Related Projects

MultiwovenMultiwoven

🔥🔥🔥 Open source Reverse ETL - alternative to hightouch and census.

Stars1,649
Forks86
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub