csv
Fast, flexible CSV reading and writing for Rust, with Serde support
Repository Health
Technical Analysis
The csv crate is BurntSushi’s fast CSV parser/writer for Rust, offering both a convenient, allocation-friendly high-level API and a low-level, allocation-free csv-core layer for performance-critical or no_std contexts. It handles the messy realities of real-world CSV — custom delimiters, quoting, variable record lengths, and encoding edge cases — while integrating directly with Serde so CSV rows can be deserialized straight into typed structs (and serialized back out) with minimal boilerplate.
The repository ships as three crates (csv, csv-core, csv-index) plus an extensive tutorial and cookbook built into the docs, reflecting its long history as one of the most widely relied-upon data-parsing crates in the Rust ecosystem.
What You Get
- High-level
Reader/Writertypes for parsing and generating CSV from files, byte slices, or anyio::Read/io::Write - First-class Serde integration for deserializing CSV rows directly into typed structs and serializing structs back to CSV
- Support for custom delimiters, quoting styles, flexible record lengths, and both
StringRecord/ByteRecord(valid-UTF-8 vs raw-bytes) row types - A separate, allocation-free
csv-corecrate forno_stdor performance-critical parsing without the high-level convenience layer - A built-in tutorial and cookbook (
src/tutorial.rs,src/cookbook.rs) with runnable examples for common read/write/performance patterns
Common Use Cases
- Loading CSV data exports (analytics, financial, log data) directly into typed Rust structs via Serde for further processing
- Streaming very large CSV files without loading them entirely into memory, using the low-level
csv-coreAPI - Writing structured data (reports, batch job output) out to CSV for downstream consumption by spreadsheets or other tools
- Handling messy real-world CSV variants (custom delimiters, inconsistent quoting, ragged rows) that stricter parsers reject
Under The Hood
Architecture - The csv crate wraps the csv-core crate’s allocation-free, no_std-compatible parsing state machine with a buffered, allocating Reader/Writer layer; StringRecord/ByteRecord (src/string_record.rs, src/byte_record.rs) represent a parsed row either as validated UTF-8 or raw bytes, and src/deserializer.rs/src/serializer.rs bridge those records to/from Serde’s Deserialize/Serialize traits so structs can be read or written directly; csv-index builds on top of csv to provide indexed/random-access reads over large CSV files.
Tech Stack - Pure Rust across three workspace crates (csv, csv-core, csv-index), dual-licensed MIT/Unlicense, with benches/bench.rs for performance regression tracking and a CI pipeline (ci/script.sh) that runs the full test and benchmark suite; the crate deliberately avoids unnecessary dependencies to keep compile times and binary size low.
Code Quality - tests/tests.rs plus embedded doc-tests throughout src/tutorial.rs and src/cookbook.rs mean the extensive documentation examples are themselves compiled and checked as part of the test suite, preventing doc drift; the split between StringRecord and ByteRecord is a deliberate design choice to handle non-UTF-8 CSV data without panicking, reflecting attention to real-world data quality issues.
API Design - The crate is unusually well-documented for a Rust library, with an in-crate tutorial that walks from basic reading through Serde integration to performance tuning (allocation reuse, csv-core fallback), which substantially lowers the learning curve for a domain (CSV parsing) that has many easy-to-miss edge cases.
Used by 17 apps in this directory
AppFlowy
Productivity · Project Management · Collaboration
The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.
cocoindex
Data Engineering · AI Development
An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.
fabro
Developer Tools · Devops
Define AI agent workflows as code graphs, route tasks across any LLM, and intervene only where it matters.
Fluree DB
Databases
A temporal, verifiable graph database with git-like branching, integrated vector/text/geo search, and RDF/SPARQL/JSON-LD/openCypher support — benchmarked at 10.4x faster than the next database on the full Wikidata dump.
Jan
AI Assistants
Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.
Meilisearch
Search
Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.
mesh-llm
AI Development · AI Agents
Mesh LLM pools GPUs and memory across every machine you own into one OpenAI-compatible API, so agents tap distributed compute instead of a single GPU box or a metered cloud bill.
Murr
Databases
A RocksDB-based NVMe/S3 cache purpose-built for AI inference workloads — a faster Redis replacement optimized for batch, low-latency, zero-copy reads and writes between data pipelines and inference apps.
ParadeDB
Search · Databases · Analytics
Born out of Y Combinator's S2023 batch, ParadeDB is a Postgres extension that delivers Elasticsearch-quality BM25 search and real-time analytics without a separate search cluster to manage.