streaming-cassava

Cassava support for the streaming ecosystem

LTS Haskell 20.26:0.2.0.0
Stackage Nightly 2022-11-17:0.2.0.0
Latest on Hackage:0.2.0.0

See all snapshots streaming-cassava appears in

MIT licensed by Ivan Lazar Miljenovic
Maintained by [email protected]
This version can be pinned in stack with:streaming-cassava-0.2.0.0@sha256:aea99400ef6e7fa064bb275601503544608b8e3fbee6f6c661b019033dc40d11,1812

Module documentation for 0.2.0.0

streaming-cassava

Hackage Build Status

cassava support for the streaming ecosystem

This library allows you to easily stream CSV data in and out. You can do so using both “plain” record-based (with optional header support) or name-based (header required to determine ordering) encoding/decoding.

All encoding/decoding options are supported, it’s possible to automatically add on default headers and you can even choose whether to fail on the first parse error or handle errors on a row-by-row basis.

Reading data from file

A common use-case is to stream CSV-encoded data in from a file. You may be tempted to use readFile from streaming-bytestring to obtain the file contents, and for simple cases this should suffice. However, the recommended solution is to use the streaming-with package for the IO aspects. You can then write something like:

withBinaryFileContents \"myFile.csv\" $
  doSomethingWithStreamingCSV
  . 'decodeByName'

Changes

Revision history for streaming-cassava

0.2.0.0 – 2021-02-28

  • Support streaming-bytestring-0.2.*

0.1.0.2 – 2021-02-28

  • Fix issues with readFile.

0.1.0.1 – 2018-01-23

  • Bump dependency on streaming.

  • Document what to do with readFile errors.

0.1.0.0 – 2017-06-30

  • First version.