https://github.com/almide/csv
CSV parser and serializer for Almide. Quoted fields, header rows, roundtrip-safe.
https://github.com/almide/csv
almide csv parser
Last synced: 5 days ago
JSON representation
CSV parser and serializer for Almide. Quoted fields, header rows, roundtrip-safe.
- Host: GitHub
- URL: https://github.com/almide/csv
- Owner: almide
- Created: 2026-03-29T05:43:21.000Z (11 days ago)
- Default Branch: main
- Last Pushed: 2026-03-29T11:41:55.000Z (11 days ago)
- Last Synced: 2026-03-29T13:48:42.127Z (10 days ago)
- Topics: almide, csv, parser
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# almide/csv
CSV parser and serializer for [Almide](https://github.com/almide/almide). Pure Almide implementation with RFC 4180 support.
## Install
```bash
almide add almide/csv
```
## Usage
```almide
import csv
// Parse CSV text to array of arrays
let data = csv.parse("name,age\nAlice,30\nBob,25")!
// Parse with header row → array of objects
let records = csv.parse_records("name,age\nAlice,30\nBob,25")!
// Stringify array of arrays
let text = csv.stringify(data)
// Stringify array of objects (auto-generates header)
let text = csv.stringify_records(records)
```
## API
| Function | Signature | Description |
|---|---|---|
| `csv.parse` | `(String) -> Result[Value, String]` | Parse to array of arrays |
| `csv.parse_records` | `(String) -> Result[Value, String]` | Parse with header row → array of objects |
| `csv.stringify` | `(Value) -> String` | Serialize array of arrays to CSV |
| `csv.stringify_records` | `(Value) -> String` | Serialize array of objects to CSV (with header) |
## Features
- Quoted fields (`"hello, world"`)
- Escaped quotes (`""` → `"`)
- Newlines within quoted fields
- CRLF and LF line endings
- Empty fields
- Roundtrip-safe: parse then stringify preserves data
## License
MIT