Skip to content

bcpeinhardt/gsv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gsv

Package Version Hex Docs

A simple csv parser and serialiser for 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:

gleam add gsv@4

About

A simple csv parser and encoder written in gleam

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages