streaming-cassava: Cassava support for the streaming ecosystem

[ data, library, mit, streaming ] [ Propose Tags ]

Stream values to/from CSV using Cassava.

Support is available for both named and "plain" data types, optional header support and option handling.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.2.0.0
Change log ChangeLog.md
Dependencies base (>=4.8 && <5), bytestring, cassava (>=0.5 && <0.6), mtl, streaming (>=0.1.1.0 && <0.3), streaming-bytestring (>=0.2 && <0.3), transformers [details]
License MIT
Copyright Ivan Lazar Miljenovic
Author Ivan Lazar Miljenovic
Maintainer Ivan.Miljenovic@gmail.com
Category Data, Streaming
Source repo head: git clone https://github.com/haskell-streaming/streaming-cassava.git
Uploaded by IvanMiljenovic at 2021-02-28T09:46:14Z
Distributions
Reverse Dependencies 5 direct, 2 indirect [details]
Downloads 3515 total (31 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-02-28 [all 1 reports]

Readme for streaming-cassava-0.2.0.0

[back to package description]

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'