csv
8.0.0, released 8 months ago by an unverified publisher
Parse and generate CSV strings with stream support and Excel compatibility.
What it does
Provides functions and stream transformers to encode Dart lists to CSV and decode CSV strings back to Dart structures. Supports custom delimiters, Excel‑compatible output, auto‑detection, and optional dynamic typing.
AI-written summary of version 8.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Reading or writing CSV files, especially large ones via streams
- Need Excel‑compatible CSV output (BOM, ';' separator)
- Want automatic delimiter detection or dynamic typing
Skip it when
- Working with binary or non‑textual data formats
- Require strict schema validation or relational features
- Need a full‑featured data storage solution
Strengths
- Stream‑friendly API for low‑memory processing
- Excel compatibility and auto‑delimiter detection
- Configurable delimiters, quoting, and dynamic typing
- High performance and low memory usage
Weaknesses
- Only handles CSV, no other data formats
- No built‑in validation or schema enforcement
- Limited to text processing; not a full data storage solution
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:csv/csv.dart';
void main() {
final data = [
['Name', 'Age', 'City'],
['Alice', 30, 'New York'],
['Bob', 25, 'London'],
];
final csvString = csv.encode(data);
print(csvString);
final decoded = csv.decode(csvString);
print(decoded);
}Alternatives
Packages that do the same job and could replace csv.
- validators2
String validation and sanitization for Dart.
83Compare - asn1lib
Encodes and decodes ASN.1 objects using BER byte encoding in Dart.
85Compare - snowplow_tracker
Flutter package for sending Snowplow analytics events on Android, iOS, and Web.
78Compare - qs_dart
A query string encoding and decoding library for Dart ported from JavaScript's qs.
77Compare
Works with
Packages commonly used together with csv: ones it builds on, ones built on it, and its own family.
- dcliBuilt on csvA Dart SDK for building cross‑platform command line applications and scripts.
- fit_toolBuilt on csvA library for reading and writing Garmin FIT fitness activity files.
- activity_filesBuilt on csvToolkit for parsing, editing, validating, and converting workout activity files in GPX, TCX, FIT, GeoJSON, and CSV.
- ml_dataframeBuilt on csvAn in-memory untyped data storage with querying and modification capabilities.
- to_csvBuilt on csvCreate and download CSV or Excel files from lists of data with ease.
- arb_generatorBuilt on csvGenerate ARB localization files from CSV files.
- geocoder_offlineBuilt on csvPackage for super-fast offline reverse geocoding using a custom data file.
- ytBuilt on csvNative Dart interface to YouTube REST APIs including Data, Live Streaming, and Analytics.