package csv

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. csv
  2. HeaderDecoderOps0
  3. HeaderDecoderOps1
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package engine
  2. package generic
  3. package laws
  4. package ops

Type Members

  1. type CellCodec[A] = Codec[String, A, DecodeError, codecs.type]

    Aggregates a CellEncoder and a CellDecoder.

    Aggregates a CellEncoder and a CellDecoder.

    The sole purpose of this type class is to provide a convenient way to create encoders and decoders. It should not be used directly for anything but instance creation - in particular, it should never be used in a context bound or expected as an implicit parameter.

    See also

    kantan.codecs.Codec

  2. trait CellCodecInstances extends CellEncoderInstances with CellDecoderInstances

    All default CellCodec instances.

  3. type CellDecoder[A] = Decoder[String, A, DecodeError, codecs.type]

    Describes how to decode CSV cells into specific types.

    Describes how to decode CSV cells into specific types.

    All types A such that there exists an implicit instance of CellDecoder[A] in scope can be decoded from CSV cells.

    Note that instances of this type class are rarely used directly - their purpose is to be implicitly assembled into more complex instances of kantan.csv.RowDecoder.

    See the companion object for creation and summoning methods.

    See also

    kantan.codecs.Decoder

  4. trait CellDecoderInstances extends AnyRef

    All default CellDecoder instances.

  5. type CellEncoder[A] = Encoder[String, A, codecs.type]

    Describes how to encode values of a specific type to CSV cells.

    Describes how to encode values of a specific type to CSV cells.

    All types A such that there exists an implicit instance of CellEncoder[A] in scope can be encoded to CSV cells.

    Note that instances of this type class are rarely used directly - their purpose is to be implicitly assembled into more complex instances of RowEncoder.

    See the companion object for creation and summoning methods.

    See also

    kantan.codecs.Encoder

  6. trait CellEncoderInstances extends AnyRef

    All default CellEncoder instances.

  7. final case class CsvConfiguration(cellSeparator: Char, quote: Char, quotePolicy: QuotePolicy, header: Header) extends Product with Serializable

    Configuration for how to read / write CSV data.

    Configuration for how to read / write CSV data.

    Note that all engines don't necessarily support all features.

  8. type CsvReader[A] = ResourceIterator[A]

    Iterator on CSV data.

  9. trait CsvSink[-S] extends VersionSpecificCsvSink[S] with Serializable

    Type class for all types that can be turned into CsvWriter instances.

    Type class for all types that can be turned into CsvWriter instances.

    Instances of CsvSink are rarely used directly. The preferred, idiomatic way is to use the implicit syntax provided by CsvSinkOps, brought in scope by importing kantan.csv.ops._.

    See the companion object for default implementations and construction methods.

  10. trait CsvSource[-S] extends Serializable

    Turns instances of S into valid sources of CSV data.

    Turns instances of S into valid sources of CSV data.

    Instances of CsvSource are rarely used directly. The preferred, idiomatic way is to use the implicit syntax provided by CsvSourceOps, brought in scope by importing kantan.csv.ops._.

    See the companion object for default implementations and construction methods.

  11. trait CsvWriter[A] extends VersionSpecificCsvWriter[A] with Closeable

    Type of values that know how to write CSV data.

    Type of values that know how to write CSV data.

    There should almost never be a reason to implement this trait directly. The default implementation should satisfy most needs, and others can be swapped if needed through the kantan.csv.engine.WriterEngine mechanism.

    A

    type of values that will be encoded as CSV.

  12. sealed abstract class DecodeError extends ReadError

    Parent type for all errors that can occur while decoding CSV data.

  13. type DecodeResult[A] = Either[DecodeError, A]

    Result of a decode operation.

    Result of a decode operation.

    The difference between a parse and a decode result is that the former comes from reading raw data and trying to interpret it as CSV, while the later comes from turning CSV data into useful Scala types.

    Failure cases are all encoded as DecodeError.

  14. trait GeneratedHeaderCodecs extends AnyRef
  15. trait GeneratedHeaderDecoders extends AnyRef
  16. trait GeneratedHeaderEncoders extends AnyRef
  17. trait GeneratedRowCodecs extends AnyRef

    Defines RowDecoder instances for types with various arities.

  18. trait GeneratedRowDecoders extends AnyRef

    Provides RowDecoder instance construction methods.

  19. trait GeneratedRowEncoders extends AnyRef

    Provides RowEncoder instance construction methods.

    Provides RowEncoder instance construction methods.

    Annotations
    @SuppressWarnings()
  20. trait HeaderCodec[A] extends HeaderEncoder[A] with HeaderDecoder[A]
  21. trait HeaderDecoder[A] extends Serializable

    Provides support for using header values rather than row indexes for decoding.

    Provides support for using header values rather than row indexes for decoding.

    When decoding CSV data, if the CsvConfiguration indicates the presence of a header, it will be passed to fromHeader, and the resulting RowDecoder will be used.

    The default behaviour is always to rely on indexes (that is, any instance of RowDecoder that might be available), but you can create more useful HeaderDecoder instances through the companion object.

  22. trait HeaderDecoderOps0 extends HeaderDecoderOps1
  23. trait HeaderDecoderOps1 extends AnyRef
  24. trait HeaderEncoder[A] extends Serializable
  25. sealed abstract class ParseError extends ReadError

    Parent type for all errors that can occur while parsing CSV data.

  26. type ParseResult[A] = Either[ParseError, A]

    Result of a parsing operation.

    Result of a parsing operation.

    The difference between a parse and a decode result is that the former comes from reading raw data and trying to interpret it as CSV, while the later comes from turning CSV data into useful Scala types.

    Failure cases are all encoded as ParseError.

  27. trait PlatformSpecificCellCodecInstances extends AnyRef
  28. trait PlatformSpecificCellDecoderInstances extends AnyRef
  29. trait PlatformSpecificCellEncoderInstances extends AnyRef
  30. sealed abstract class ReadError extends Error

    Parent type for all errors that can occur while dealing with CSV data.

    Parent type for all errors that can occur while dealing with CSV data.

    ReadError is split into two main error types:

    • DecodeError: errors that occur while decoding a cell or a row.
    • ParseError: errors that occur while parsing raw data into CSV.
  31. type ReadResult[A] = Either[ReadError, A]

    Result of a reading operation.

    Result of a reading operation.

    Both kantan.csv.ParseResult and DecodeResult are valid values of type ReadResult.

  32. type RowCodec[A] = Codec[Seq[String], A, DecodeError, codecs.type]

    Aggregates a RowEncoder and a RowDecoder.

    Aggregates a RowEncoder and a RowDecoder.

    The sole purpose of this type class is to provide a convenient way to create encoders and decoders. It should not be used directly for anything but instance creation - in particular, it should never be used in a context bound or expected as an implicit parameter.

    See also

    kantan.codecs.Codec

  33. trait RowCodecInstances extends RowEncoderInstances with RowDecoderInstances

    All default RowCodec instances.

  34. type RowDecoder[A] = Decoder[Seq[String], A, DecodeError, codecs.type]

    Describes how to decode CSV rows into specific types.

    Describes how to decode CSV rows into specific types.

    See the companion object for creation and summoning methods.

    See also

    kantan.codecs.Decoder

  35. trait RowDecoderInstances extends AnyRef

    Provides reasonable default RowDecoder instances for various types.

  36. type RowEncoder[A] = Encoder[Seq[String], A, codecs.type]

    Describes how to encode values of a specific type to CSV rows.

    Describes how to encode values of a specific type to CSV rows.

    See the companion object for creation and summoning methods.

    See also

    kantan.codecs.Encoder

  37. trait RowEncoderInstances extends VersionSpecificRowEncoderInstances

    Provides reasonable default RowEncoder instances for various types.

  38. trait TupleInstances extends AnyRef

    Provides RowDecoder and RowEncoder instances for tuples of any arity.

  39. trait VersionSpecificCsvSink[-S] extends AnyRef
  40. trait VersionSpecificCsvWriter[A] extends AnyRef
  41. trait VersionSpecificRowEncoderInstances extends AnyRef
  42. trait Zippable[-A, -B] extends AnyRef
  43. trait ZippableOps1 extends ZippableOps2
  44. trait ZippableOps2 extends ZippableOps3
  45. trait ZippableOps3 extends AnyRef

Value Members

  1. implicit def enrichedHeaderDecoder0[A](decoder: HeaderDecoder[Option[A]]): EnrichedHeaderDecoder0[A]
    Definition Classes
    HeaderDecoderOps0
  2. implicit def enrichedHeaderDecoder1[A](decoder: HeaderDecoder[A]): EnrichedHeaderDecoder1[A]
    Definition Classes
    HeaderDecoderOps1
  3. val rfc: CsvConfiguration
  4. object CellCodec extends CodecCompanion[String, DecodeError, codecs.type] with PlatformSpecificCellCodecInstances

    Declares helpful methods for CellCodec creation.

  5. object CellDecoder extends DecoderCompanion[String, DecodeError, codecs.type] with PlatformSpecificCellDecoderInstances

    Provides useful methods for summoning and creating instances of CellDecoder.

  6. object CellEncoder extends EncoderCompanion[String, codecs.type] with PlatformSpecificCellEncoderInstances

    Provides useful methods for summoning and creating instances of CellEncoder.

  7. object CsvConfiguration extends Serializable
  8. object CsvReader

    Provides instance creation and summoning methods.

  9. object CsvSink extends Serializable

    Provides default instances as well as instance summoning and creation methods.

  10. object CsvSource extends Serializable

    Defines convenience methods for creating and retrieving instances of CsvSource.

    Defines convenience methods for creating and retrieving instances of CsvSource.

    Implicit default implementations of standard types are also declared here, always bringing them in scope with a low priority.

    These default implementations can also be useful when writing more complex instances: if you need to write a CsvSource[T] and have both a CsvSource[S] and a T ⇒ S, you need just use CsvSource.contramap to create your implementation.

  11. object CsvWriter

    Provides useful instance creation methods.

  12. object DecodeError extends Serializable

    Declares all possible values of type DecodeError.

  13. object DecodeResult extends WithError[DecodeError]

    Provides convenience methods for creating instances of DecodeResult.

  14. object HeaderCodec extends GeneratedHeaderCodecs with Serializable
  15. object HeaderDecoder extends GeneratedHeaderDecoders with Serializable

    Provides instance summoning and creation methods for HeaderDecoder.

  16. object HeaderDecoderOps0
  17. object HeaderDecoderOps1
  18. object HeaderEncoder extends GeneratedHeaderEncoders with Serializable
  19. object ParseError extends Serializable

    Declares all possible values of type ParseError.

  20. object ParseResult extends WithDefault[ParseError]

    Provides convenience methods for creating instances of ParseResult.

  21. object ReadResult extends Simple[ReadError]

    Provides useful methods for creating instances of ReadResult.

  22. object RowCodec extends GeneratedRowCodecs with CodecCompanion[Seq[String], DecodeError, codecs.type]

    Provides useful methods for RowCodec instance creation.

  23. object RowDecoder extends GeneratedRowDecoders with DecoderCompanion[Seq[String], DecodeError, codecs.type]

    Provides various instance creation and summoning methods.

    Provides various instance creation and summoning methods.

    The instance creation functions are important to know about, as they make the task of creating new decoders easier and more correct. There are two main families, depending on the type to decode:

    • decoder: creates decoders from a function of arity XXX and for which you need to specify a mapping parameter to row index (such as if the order in which cells are written doesn't match that of the function's parameters).
    • ordered: create decoders from a function of arity XXX such that its parameters are organised in exactly the same way as CSV rows.

    Note that a lot of types already have implicit instances: tuples, collections... moreover, the generics module can automatically derive valid instances for a lot of common scenarios.

  24. object RowEncoder extends GeneratedRowEncoders with EncoderCompanion[Seq[String], codecs.type]

    Provides various instance creation and summoning methods.

    Provides various instance creation and summoning methods.

    The instance creation functions are important to know about, as they make the task of creating new encoders easier and more correct. There are four main families, depending on the type to encode:

    • encoder: creates encoders from a function for which you need to specify a mapping row index to parameter (such as if you need to skip some CSV cells, for instance).
    • ordered: create encoders from a function such that its parameters are organised in exactly the same way as CSV rows.
    • caseEncoder: specialisation of encoder for case classes.
    • caseOrdered: specialisation of ordered for case classes.

    Note that a lot of types already have implicit instances: tuples, collections... moreover, the generics module can automatically derive valid instances for a lot of common scenarios.

  25. object Zippable extends ZippableOps1
  26. object codecs extends CellCodecInstances with RowCodecInstances with TupleInstances

    Defines default instances for CellEncoder, CellDecoder, RowEncoder and RowDecoder.

Inherited from HeaderDecoderOps0

Inherited from HeaderDecoderOps1

Inherited from AnyRef

Inherited from Any

Ungrouped