Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. csv

csv

MITElixir

RFC 4180 compliant, composable CSV parsing and encoding library for Elixir.

GitHubGitHub
515 stars94 forks0 contributors

What is csv?

CSV is an Elixir library for decoding and encoding CSV files, designed to handle the format's notorious inconsistencies gracefully. It focuses on extracting all correctly formatted rows from data pipelines while providing clear error diagnostics for problematic lines. The library is RFC 4180 compliant and follows a composable, stream-based design.

Target Audience

Elixir developers building data processing pipelines that need to parse or generate CSV files, especially when dealing with imperfect or inconsistently formatted data sources.

Value Proposition

Developers choose this library for its robust error handling in normal mode, which returns all valid rows with descriptive errors, and its seamless integration with Elixir streams for composable data processing. Its performance-oriented design, using fast binary matching, ensures it rarely becomes a bottleneck.

Overview

CSV Decoding and Encoding for Elixir

Use Cases

Best For

  • Processing large CSV files in Elixir with streaming to avoid memory issues.
  • Extracting all correctly formatted rows from inconsistent CSV data while logging errors.
  • Building data pipelines where CSV parsing is one step among many composable operations.
  • Strict validation of CSV files where raising an exception on the first error is required.
  • Handling CSV files with custom separators, escape characters, or formula escaping needs.
  • Encoding Elixir data structures to CSV with polymorphic support for custom types via protocols.

Not Ideal For

  • Projects outside the Elixir ecosystem requiring CSV processing in other languages like Python or JavaScript.
  • Applications needing built-in CSV visualization, GUI editing tools, or interactive dashboards.
  • Use cases where CSV files are always perfectly formatted and a minimal, zero-dependency parser (e.g., simple string splitting) is sufficient.
  • Real-time data pipelines requiring low-latency, stateful stream processing with complex event-driven logic beyond batch-oriented CSV parsing.

Pros & Cons

Pros

Robust Error Handling

In normal mode, decode returns a stream of ok/error tuples, extracting all valid rows even with malformed lines, as emphasized in the README for handling fickle CSV formats.

High Performance Parsing

Uses fast binary matching to parse ~500k rows per second on modest hardware, ensuring it rarely bottlenecks data pipelines, per performance benchmarks.

Seamless Stream Integration

Designed to work with Elixir streams and enumerables, fitting composably into data processing pipelines without extra overhead, following UNIX philosophy.

Flexible Configuration

Supports custom separators, escape characters, field transformations, and formula unescaping, allowing adaptation to various CSV dialects as shown in decode options.

Extensible Encoding

Allows custom data type encoding via the CSV.Encode protocol, enabling polymorphic output for complex structures, detailed in the encoding section.

Cons

Removed Parallelism

Version 3.x eliminated parallelism features (num_workers, worker_work_ratio), which could reduce throughput on multi-core systems for large files compared to earlier versions.

Manual Performance Tuning

Optimal byte streaming requires fine-tuning chunk sizes (e.g., default 1000 bytes), adding complexity for developers to achieve best performance, as noted in the performance tips.

Protocol Consolidation Overhead

For efficient encoding, protocols must be consolidated (consolidate_protocols: true), an extra setup step that can be overlooked and lead to performance degradation.

Frequently Asked Questions

Quick Stats

Stars515
Forks94
Contributors0
Open Issues5
Last commit1 year ago
CreatedSince 2015

Tags

#parsing#stream-processing#hex#encoder#elixir#file-format#rfc-4180#csv#decoding#stream#data-processing#encoding#hex-package#decoder#parser#csv-parser

Built With

E
Elixir

Included in

Elixir13.1k
Auto-fetched 1 day ago

Related Projects

nimble_csvnimble_csv

A simple and fast CSV parsing and dumping library for Elixir

Stars820
Forks59
Last commit7 days ago
csv2sqlcsv2sql

A blazing fast fully-automated CSV to database importer

Stars58
Forks3
Last commit1 month ago
csvlixircsvlixir

A CSV reading/writing application for Elixir.

Stars33
Forks4
Last commit7 months ago
cessocesso

CSV handling library for Elixir.

Stars27
Forks7
Last commit12 years 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