The csv-enumerator package

[Tags: bsd3, library]

For more information and examples, check out the README at: The API is fairly well documented and I would encourage you to keep your haddocks handy.

[Skip to ReadMe]


Versions0.8, 0.8.2, 0.9.0, 0.9.2,, 0.9.3, 0.9.5,,,
Change logNone available
Dependenciesattoparsec (==0.8.*), attoparsec-enumerator (>=, base (==4.*), bytestring, containers (>=0.3), directory, enumerator (>=0.4.5 && <0.5), safe, transformers (>=0.2), unix-compat (>= [details]
AuthorOzgun Ataman
MaintainerOzgun Ataman <>
Home page
UploadedFri Apr 29 22:37:18 UTC 2011 by OzgunAtaman
Downloads1506 total (64 in last 30 days)
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]




Maintainers' corner

For package maintainers and hackage trustees

Readme for csv-enumerator-0.8


CSV Files and Haskell

CSV files are the de-facto standard in many cases of data transfer, particularly when dealing with enterprise application or disparate database systems.

While there are a number of csv libraries in Haskell, at the time of this project's start in 2010, there wasn't one that provided all of the following:

This library is an attempt to close this gap.

This package

csv-enumerator is an enumerator-based CSV parsing library that is easy to use, flexible and fast. Furthermore, it provides ways to use constant-space during operation, which is absolutely critical in many real world use cases.


API Docs

The API is quite well documented and I would encourage you to keep it handy.


While fast operation is of concern, I have so far cared more about correct operation and a flexible API. Please let me know if you notice any performance regressions or optimization opportunities.

Usage Examples

Example 1: Basic Operation

{-# LANGUAGE OverloadedStrings #-}

import Data.CSV.Enumerator
import Data.Char (isSpace)
import qualified Data.Map as M
import Data.Map ((!))

-- Naive whitespace stripper
strip = reverse . B.dropWhile isSpace . reverse . B.dropWhile isSpace

-- A function that takes a row and "emits" zero or more rows as output.
processRow :: MapRow -> [MapRow]
processRow row = [M.insert "Column1" fixedCol row]
  where fixedCol = strip (row ! "Column1")

main = mapCSVFile "InputFile.csv" defCSVSettings procesRow "OutputFile.csv"

and we are done.

Further examples to be provided at a later time.

TODO - Next Steps

Any and all kinds of help is much appreciated!