fs2.data.csv

package fs2.data.csv

Type members

Classlikes

@FunctionalInterface
trait CellDecoder[T]

Describes how a cell can be decoded to the given type.

Describes how a cell can be decoded to the given type.

CellDecoder provides convenient methods such as map, emap, or flatMap to build new decoders out of more basic one.

Actually, CellDecoder has a https://typelevel.org/cats/api/cats/MonadError.htmlcats`MonadError` instance. To get the full power of it, import cats.implicits._.

Companion:
object
@FunctionalInterface
trait CellEncoder[T]

Describes how a cell of a given type can be encoded.

Describes how a cell of a given type can be encoded.

Companion:
object
class CsvException(msg: String, val line: Option[Long], inner: Throwable) extends Exception
object CsvRow
class DecoderError(msg: String, val line: Option[Long], inner: Throwable) extends CsvException
sealed trait EscapeMode

Controls the escaping when outputting CSV.

Controls the escaping when outputting CSV.

Companion:
object
object EscapeMode
Companion:
class
final case class Exported[A](instance: A) extends AnyVal
sealed trait HasHeaders[H <: (Option), Header] extends RowF[H, Header] => CsvRow[Header]

Witness that a RowF has headers of a certain type.

Witness that a RowF has headers of a certain type.

Companion:
object
object HasHeaders
Companion:
class
class HeaderError(msg: String, val line: Option[Long], inner: Throwable) extends CsvException
class HeaderSizeError(msg: String, val expectedColumns: Int, val actualColumns: Int, val line: Option[Long], inner: Throwable) extends HeaderError

Raised when processing a Csv row whose width doesn't match the width of the Csv header row

Raised when processing a Csv row whose width doesn't match the width of the Csv header row

trait ParseableHeader[Header]

A type class describing what it means to be a parseable CSV header.

A type class describing what it means to be a parseable CSV header.

Companion:
object
Companion:
class
final class PartiallyAppliedDecodeGivenHeaders[T](val dummy: Boolean) extends AnyVal
final class PartiallyAppliedDecodeSkippingHeaders[T](val dummy: Boolean) extends AnyVal
final class PartiallyAppliedDecodeUsingHeaders[T](val dummy: Boolean) extends AnyVal
final class PartiallyAppliedDecodeWithoutHeaders[T](val dummy: Boolean) extends AnyVal
final class PartiallyAppliedEncodeGivenHeaders[T](val dummy: Boolean) extends AnyVal
final class PartiallyAppliedEncodeUsingFirstHeaders[T](val dummy: Boolean) extends AnyVal
final class PartiallyAppliedEncodeWithoutHeaders[T](val dummy: Boolean) extends AnyVal
Companion:
class
sealed trait QuoteHandling
Companion:
object
object Row
object RowDecoder

Describes how a row can be decoded to the given type.

Describes how a row can be decoded to the given type.

RowDecoder provides convenient methods such as map, emap, or flatMap to build new decoders out of more basic one.

Actually, RowDecoder has a cats `MonadError` instance. To get the full power of it, import cats.implicits._.

@FunctionalInterface
trait RowDecoderF[H <: (Option), T, Header]

Describes how a row can be decoded to the given type.

Describes how a row can be decoded to the given type.

RowDecoderF provides convenient methods such as map, emap, or flatMap to build new decoders out of more basic one.

Actually, RowDecoderF has a cats `MonadError` instance. To get the full power of it, import cats.implicits._.

Companion:
object
Companion:
class
object RowEncoder
@FunctionalInterface
trait RowEncoderF[H <: (Option), T, Header]

Describes how a row can be encoded from a value of the given type.

Describes how a row can be encoded from a value of the given type.

Companion:
object
Companion:
class
case class RowF[H <: (Option), Header](values: NonEmptyList[String], headers: H[NonEmptyList[Header]], line: Option[Long])

A CSV row with or without headers. The presence of headers is encoded via the first type param which is a subtype of scala.Option. By preserving this information in types, it's possible to define Row and CsvRow aliases as if they were plain case classes while keeping the code DRY.

A CSV row with or without headers. The presence of headers is encoded via the first type param which is a subtype of scala.Option. By preserving this information in types, it's possible to define Row and CsvRow aliases as if they were plain case classes while keeping the code DRY.

Operations on columns can always be performed using 0-based indices and additionally using a specified header value if headers are present (and this fact statically known).

'''Note:''' the following invariant holds when using this class: values and headers have the same size if headers are present.

Companion:
object
object RowF
Companion:
class
trait WriteableHeader[Header]
Companion:
object
Companion:
class
object lowlevel

Low level pipes for CSV handling. All pipes only perform one step in a CSV (de)serialization pipeline, so use these if you want to customise. All standard use cases should be covered by the higher level pipes directly on the csv package which are composed of the lower level ones here.

Low level pipes for CSV handling. All pipes only perform one step in a CSV (de)serialization pipeline, so use these if you want to customise. All standard use cases should be covered by the higher level pipes directly on the csv package which are composed of the lower level ones here.

Types

type CsvRow[Header] = RowF[Some, Header]

A CSV row with headers, that can be used to access the cell values.

A CSV row with headers, that can be used to access the cell values.

'''Note:''' the following invariant holds when using this class: values and headers have the same size.

type CsvRowDecoder[T, Header] = RowDecoderF[Some, T, Header]

Describes how a row can be decoded to the given type.

Describes how a row can be decoded to the given type.

CsvRowDecoder provides convenient methods such as map, emap, or flatMap to build new decoders out of more basic one.

Actually, CsvRowDecoder has a cats `MonadError` instance. To get the full power of it, import cats.implicits._.

type CsvRowEncoder[T, Header] = RowEncoderF[Some, T, Header]

Describes how a row can be encoded from a value of the given type.

Describes how a row can be encoded from a value of the given type.

type DecoderResult[T] = Either[DecoderError, T]
type HeaderResult[T] = Either[HeaderError, NonEmptyList[T]]
type NoneF[+A] = None.type

Higher kinded version of scala.None. Ignores the type param.

Higher kinded version of scala.None. Ignores the type param.

type Row = RowF[NoneF, Nothing]

A CSV row without headers.

A CSV row without headers.

type RowDecoder[T] = RowDecoderF[NoneF, T, Nothing]

Describes how a row can be decoded to the given type.

Describes how a row can be decoded to the given type.

RowDecoder provides convenient methods such as map, emap, or flatMap to build new decoders out of more basic one.

Actually, RowDecoder has a cats `MonadError` instance. To get the full power of it, import cats.implicits._.

type RowEncoder[T] = RowEncoderF[NoneF, T, Nothing]

Describes how a row can be encoded from a value of the given type.

Describes how a row can be encoded from a value of the given type.

Value members

Concrete methods

Decode a char-like stream (see CharLikeChunks) into a specified type, assuming the file contains no headers, but is compliant with the set of headers given.

Decode a char-like stream (see CharLikeChunks) into a specified type, assuming the file contains no headers, but is compliant with the set of headers given.

Decode a char-like stream (see CharLikeChunks) into a specified type, assuming the file contains headers, but they shall be skipped for decoding.

Decode a char-like stream (see CharLikeChunks) into a specified type, assuming the file contains headers, but they shall be skipped for decoding.

Decode a char-like stream (see CharLikeChunks) into a specified type, assuming the file contains headers and they need to be taken into account for decoding.

Decode a char-like stream (see CharLikeChunks) into a specified type, assuming the file contains headers and they need to be taken into account for decoding.

Decode a char-like stream (see CharLikeChunks) into a specified type, assuming the file neither contains headers nor are they needed for decoding.

Decode a char-like stream (see CharLikeChunks) into a specified type, assuming the file neither contains headers nor are they needed for decoding.

Encode a specified type into a CSV prepending the given headers.

Encode a specified type into a CSV prepending the given headers.

Encode a specified type into a CSV that contains the headers determined by encoding the first element. Empty if input is.

Encode a specified type into a CSV that contains the headers determined by encoding the first element. Empty if input is.

Encode a specified type into a CSV that contains no headers.

Encode a specified type into a CSV that contains no headers.