Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kkazuo/csv_ya

Yet another CSV parser that you may want.
https://github.com/kkazuo/csv_ya

Last synced: about 14 hours ago
JSON representation

Yet another CSV parser that you may want.

Awesome Lists containing this project

README

        

Yet another CSV parser that you may want.

## Features

- Tolerant quate escaping.
- Streaming conversion for very large files.

## Motivation

Have you ever seen a CSV like this:

```csv
x ,y
" an" "escaped"(string) ,ok
```

Be attention the white space trimming and continuations of quote escaping.

Most RFC4180 compliant CSV parsers fails to parse this.

But these data are so many in the wild where I live.
So I made this library.

We can parse this to:

```json
[
{
"x": " an escaped(string)",
"y": "ok"
}
]
```

## Usage

```dart
const input = 'a,b,c\n1,2,3';
print(parseCsv(input));
>>> [['a', 'b', 'c'], ['1', '2', '3']]
print(parseCsvAsMap(input));
>>> [{'a': '1', 'b': '2', 'c': '3'}]
```