https://github.com/bcpeinhardt/gsv
A simple csv parser and encoder written in gleam
https://github.com/bcpeinhardt/gsv
Last synced: 2 months ago
JSON representation
A simple csv parser and encoder written in gleam
- Host: GitHub
- URL: https://github.com/bcpeinhardt/gsv
- Owner: bcpeinhardt
- Created: 2023-05-24T02:54:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-08T15:22:10.000Z (3 months ago)
- Last Synced: 2025-02-14T00:17:47.226Z (2 months ago)
- Language: Gleam
- Homepage:
- Size: 80.1 KB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-gleam - gsv - [📚](https://hexdocs.pm/gsv/) - A simple csv parser and generator written in gleam (Packages / Formats)
README
# gsv
[](https://hex.pm/packages/gsv)
[](https://hexdocs.pm/gsv/)A simple csv parser and serialiser for Gleam.
```gleam
import gsv.{Unix, Windows}pub fn main() {
let csv =
"name,loves
lucy,gleam"// Parse a csv string into a list of rows.
let assert Ok(rows) = gsv.to_lists(csv)
// -> [["name", "loves"], ["lucy", "gleam"]]// If your csv has headers you can also parse it into a list of dictionaries.
let assert Ok(rows) = gsv.to_dicts(csv_str)
// -> dict.from_list([#("name", "lucy"), #("loves", "gleam")])
}
```## Installation
To add this package to your Gleam project:
```sh
gleam add gsv@3
```