Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/kkazuo/csv_ya
- Owner: kkazuo
- License: apache-2.0
- Created: 2022-12-17T06:36:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-11T09:11:18.000Z (over 1 year ago)
- Last Synced: 2023-08-09T13:59:13.970Z (over 1 year ago)
- Language: Dart
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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'}]
```