underscoreio/csv-workshop

Name: csv-workshop

Owner: Underscore

Description: Functional programming workshop exploring the magical domain of CSV parsing.

Created: 2016-02-19 11:06:38.0

Updated: 2016-02-19 11:07:09.0

Pushed: 2016-02-19 11:07:08.0

Homepage: null

Size: 150

Language: Scala

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Scala CSV Workshop

A programming workshop exploring functional programming design patterns via the exciting real-world problem domain of CSV parsing.

Workshop Copyright 2016 Dave Gurnell of Underscore. Licensed CC-BY-NC-SA 4.0.

Cities and countries sample data Copyright Statistics Finland.

Workshop Structure

The workshop will be split into three stages:

  1. Initial discussion (10 minutes).

    Discuss the problem as a group and split everyone into teams.

  2. Development (80 minutes)

    Each team writes a library to satisfy the design brief (or get as far as they can in the time).

  3. Presentation (30 minutes)

    Each team presents its design decisions; we discuss different approaches.

Design Brief

As part of a strategic push towards cutting edge technology, our CTO at Acme Widgets Pty Ltd has recommended that we migrate all of our existing and new IT infrastructure to an exciting new data interchange format called “Comma Separated Values” (aka “CSV”).

Your team has been tasked with building a library to read CSV files. Other teams will use your reader to import CSV data into their Scala applications as well-typed objects.

Feel free to use any general purpose functional programming libraries in your solution. However, do not use any libraries with CSV-specific functionality other than those provided.

The important characteristics of CSV are:

Minimum Viable Product

An MVP CSV reader should read a CSV file as a list of records of a type A. Users of the library can specify the type A and how it maps to the CSV data. The reader should interpret the CSV data, try to parse it appropriately, and report errors wherever it is unable to do so.

You have been given a low-level CSV parser to get you started. This turns raw CSV data into a List[List[String]] ready for transformation by your library. See LowLevelParser.scala and LowLevelParserSpec.scala for examples.

You have also been given two example CSV files for testing purposes: src/main/resources/cities.csv and src/main/resources/countries.csv. You can load these using the parseCsvResource method in LowLevelParser.

Non-Functional Requirements

A basic CSV reader library will:

A strong CSV reader library will also:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.