Skip to content
pubscout

csv

8.0.0, released 8 months ago by an unverified publisher

Parse and generate CSV strings with stream support and Excel compatibility.

WASM-ready
$ flutter pub add csv
Source repository

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.

  • asn1lib

    Encodes and decodes ASN.1 objects using BER byte encoding in Dart.

  • snowplow_tracker

    Flutter package for sending Snowplow analytics events on Android, iOS, and Web.

  • qs_dart

    A query string encoding and decoding library for Dart ported from JavaScript's qs.

Works with

Packages commonly used together with csv: ones it builds on, ones built on it, and its own family.