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.
kantan.codecs.Codec
All default CellCodec instances.
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.
kantan.codecs.Decoder
All default CellDecoder instances.
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.
kantan.codecs.Encoder
All default CellEncoder instances.
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.
Iterator on CSV data.
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.
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.
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.
type of values that will be encoded as CSV.
Parent type for all errors that can occur while decoding CSV data.
Result of a decode operation, which can be either a success or a failure.
Result of a decode operation, which can be either a success or a failure.
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.
kantan.codecs.Result
Defines RowDecoder instances for types with various arities.
Provides RowDecoder instance construction methods.
Provides RowEncoder instance construction methods.
Provides RowEncoder instance construction methods.
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.
Parent type for all errors that can occur while parsing CSV data.
Result of a parsing operation, which can be either a success or a failure.
Result of a parsing operation, which can be either a success or a failure.
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.
kantan.codecs.Result
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:
Result of a reading operation, which can be either a success or a failure.
Result of a reading operation, which can be either a success or a failure.
Both kantan.csv.ParseResult and DecodeResult are valid values of type ReadResult.
kantan.codecs.Result
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.
kantan.codecs.Codec
All default RowCodec instances.
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.
kantan.codecs.Decoder
Provides reasonable default RowDecoder instances for various types.
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.
kantan.codecs.Encoder
Provides reasonable default RowEncoder instances for various types.
Provides RowDecoder and RowEncoder instances for tuples of any arity.
Declares helpful methods for CellCodec creation.
Provides useful methods for summoning and creating instances of CellDecoder.
Provides useful methods for summoning and creating instances of CellEncoder.
Provides instance creation and summoning methods.
Provides default instances as well as instance summoning and creation methods.
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.
Provides useful instance creation methods.
Declares all possible values of type DecodeError.
Provides convenience methods for creating instances of DecodeResult.
Provides instance summoning and creation methods for HeaderDecoder.
Declares all possible values of type ParseError.
Provides convenience methods for creating instances of ParseResult.
Provides useful methods for creating instances of ReadResult.
Provides useful methods for RowCodec instance creation.
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.
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.
Defines default instances for CellEncoder, CellDecoder, RowEncoder and RowDecoder.