kantan.csv.ops

package kantan.csv.ops

Members list

Type members

Classlikes

final class CsvCellDecoderOps(val s: String)

Provides syntax for decoding CSV cells as values.

Provides syntax for decoding CSV cells as values.

Importing kantan.csv.ops._ will add the following methods to String:

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CsvCellEncoderOps[A](val a: A)(implicit evidence$1: CellEncoder[A])

Provides syntax for encoding values as CSV cells.

Provides syntax for encoding values as CSV cells.

Importing kantan.csv.ops._ will add asCsvCell to any type A such that there exists an implicit CellDecoder[A] in scope.

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CsvRowDecoderOps(val ss: Seq[String])

Provides syntax for decoding CSV rows as values.

Provides syntax for decoding CSV rows as values.

Importing kantan.csv.ops._ will add the following methods to Seq[String]:

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CsvRowEncoderOps[A](val a: A)(implicit evidence$1: RowEncoder[A])

Provides syntax for encoding values as CSV rows.

Provides syntax for encoding values as CSV rows.

Importing kantan.csv.ops._ will add asCsvRow to any type A such that there exists an implicit RowEncoder[A] in scope.

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CsvRowReadingOps[A](a: A)(implicit evidence$1: CsvSource[A])

Provides syntax for decoding a string as a CSV row.

Provides syntax for decoding a string as a CSV row.

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CsvRowWritingOps[A](a: A)(implicit evidence$1: RowEncoder[A])

Provides syntax for encoding single CSV rows as a string.

Provides syntax for encoding single CSV rows as a string.

Writing a single row as a String is a surprisingly recurrent feature request. This is how to do it:

scala> import kantan.csv.rfc

scala> (1, 2, 3).writeCsvRow(rfc)
res0: String = 1,2,3

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CsvRowsOps[A](val as: IterableOnce[A])(implicit evidence$1: HeaderEncoder[A])

Provides syntax for turning collections into CSV strings.

Provides syntax for turning collections into CSV strings.

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CsvSinkOps[A](val a: A)(implicit evidence$1: CsvSink[A]) extends VersionSpecificCsvSinkOps[A]

Provides useful syntax for types that have implicit instances of CsvSink in scope.

Provides useful syntax for types that have implicit instances of CsvSink in scope.

The most common use case is to turn a value into a CsvWriter:

 val f: java.io.File = ???
 f.asCsvWriter[List[Int]](',', true)

A slightly less common use case is encode an entire collection to CSV:

 val f: java.io.File = ???
 f.writeCsv[List[Int]](List(List(1, 2, 3), List(4, 5, 6)), ',', true)

Attributes

Supertypes
class Object
trait Matchable
class Any
final class CsvSourceOps[A](val a: A)(implicit evidence$1: CsvSource[A])

Provides useful syntax for types that have implicit instances of CsvSource in scope.

Provides useful syntax for types that have implicit instances of CsvSource in scope.

The most common use case is to turn a value into a CsvReader:

scala> import kantan.csv._

scala> "1,2,3\n4,5,6".asCsvReader[List[Int]](rfc).toList
res0: List[ReadResult[List[Int]]] = List(Right(List(1, 2, 3)), Right(List(4, 5, 6)))

A slightly less common use case is to load an entire CSV file in memory:

scala> "1,2,3\n4,5,6".readCsv[List, List[Int]](rfc)
res1: List[ReadResult[List[Int]]] = List(Right(List(1, 2, 3)), Right(List(4, 5, 6)))

Unsafe versions of these methods are also available, even if usually advised against.

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object cellDecoder

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object cellEncoder

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object rowDecoder

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object rowEncoder

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
trait ToCsvRowsOps

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object csvRows
trait ToCsvSinkOps

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object sink

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object source

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class CsvSinkOps[A]
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object csvRows extends ToCsvRowsOps

Attributes

Supertypes
trait ToCsvRowsOps
class Object
trait Matchable
class Any
Self type
csvRows.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
rowDecoder.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
rowEncoder.type
object sink extends ToCsvSinkOps

Attributes

Supertypes
trait ToCsvSinkOps
class Object
trait Matchable
class Any
Self type
sink.type
object source extends ToCsvSourceOps

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
source.type

Implicits

Inherited implicits

Attributes

Inherited from:
ToCsvCellDecoderOps
implicit def toCsvCellEncoderOps[A : CellEncoder](a: A): CsvCellEncoderOps[A]

Attributes

Inherited from:
ToCsvCellEncoderOps
implicit def toCsvInputOps[A : CsvSource](a: A): CsvSourceOps[A]

Attributes

Inherited from:
ToCsvSourceOps
implicit def toCsvOutputOps[A : CsvSink](a: A): CsvSinkOps[A]

Attributes

Inherited from:
ToCsvSinkOps

Attributes

Inherited from:
ToCsvRowDecoderOps
implicit def toCsvRowEncoderOps[A : HeaderEncoder](a: A): CsvRowEncoderOps[A]

Attributes

Inherited from:
ToCsvRowEncoderOps
implicit def toCsvRowReadingOps[A : CsvSource](a: A): CsvRowReadingOps[A]

Attributes

Inherited from:
ToCsvRowReadingOps
implicit def toCsvRowWritingOps[A : RowEncoder](a: A): CsvRowWritingOps[A]

Attributes

Inherited from:
ToCsvRowWritingOps
implicit def toCsvRowsOps[A : HeaderEncoder](as: IterableOnce[A]): CsvRowsOps[A]

Attributes

Inherited from:
ToCsvRowsOps