RubyFlow The Ruby and Rails community linklog

csvrecord - read in comma-separated values (csv) records with typed structs / schemas

Hello, I’ve put together a new library / gem, that is, csvrecord - that lets you read in comma-separated values (csv) records with typed structs / schemas e.g. use beers = Beer.read( 'beer.csv' ).to_a; beers[0].brewery instead of rows = CSV.read( 'beer.csv', headers: true ); rows[0]['Brewery'] and so on. Why care about CSV? It’s the world’s most popular tabular data interchange format in text :-). Happy data / text wrangling with ruby. Cheers. Prost. PS: For some getting started .csv datafiles, see the /football.csv collection (incl. English Premier League, Bundesliga, Seria A, Ligue 1, European Cup, etc.).

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in