package csv
- Source
- package.scala
- Alphabetic
- By Inheritance
- csv
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait CellDecoder[T] extends AnyRef
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 asmap
,emap
, orflatMap
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, importcats.syntax.all._
.- Annotations
- @implicitNotFound() @FunctionalInterface()
- trait CellDecoderInstances1 extends AnyRef
- trait CellDecoderInstances2 extends AnyRef
- trait CellEncoder[T] extends AnyRef
Describes how a cell of a given type can be encoded.
Describes how a cell of a given type can be encoded.
- Annotations
- @implicitNotFound() @FunctionalInterface()
- trait CellEncoderInstances1 extends AnyRef
- trait CellEncoderInstances2 extends AnyRef
- class CsvException extends Exception
- 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
andheaders
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 asmap
,emap
, orflatMap
to build new decoders out of more basic one.Actually,
CsvRowDecoder
has a catsMonadError
instance. To get the full power of it, importcats.syntax.all._
.- Annotations
- @implicitNotFound()
- 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.
- Annotations
- @implicitNotFound()
- class DecoderError extends CsvException
- type DecoderResult[T] = Either[DecoderError, T]
- trait EnumDecoders extends AnyRef
- trait EnumEncoders extends AnyRef
- sealed trait EscapeMode extends AnyRef
Controls the escaping when outputting CSV.
- final case class Exported[A](instance: A) extends AnyVal with Product with Serializable
- trait ExportedCellDecoders extends AnyRef
- trait ExportedCellEncoders extends AnyRef
- trait ExportedRowDecoderFs extends AnyRef
- trait ExportedRowEncoderFs extends AnyRef
- sealed trait HasHeaders[H[+a] <: Option[a], Header] extends (RowF[H, Header]) => CsvRow[Header]
Witness that a RowF has headers of a certain type.
- class HeaderError extends CsvException
- type HeaderResult[T] = Either[HeaderError, NonEmptyList[T]]
- class HeaderSizeError extends HeaderError
Raised when processing a Csv row whose width doesn't match the width of the Csv header row
- trait LiteralCellDecoders extends AnyRef
- trait LiteralCellEncoders extends AnyRef
- Annotations
- @nowarn()
- type NoneF[+A] = None.type
Higher kinded version of scala.None.
Higher kinded version of scala.None. Ignores the type param.
- trait ParseableHeader[Header] extends AnyRef
A type class describing what it means to be a parseable CSV header.
- final class PartiallyAppliedDecodeGivenHeaders[T] extends AnyVal
- final class PartiallyAppliedDecodeSkippingHeaders[T] extends AnyVal
- final class PartiallyAppliedDecodeUsingHeaders[T] extends AnyVal
- final class PartiallyAppliedDecodeWithoutHeaders[T] extends AnyVal
- final class PartiallyAppliedEncodeGivenHeaders[T] extends AnyVal
- final class PartiallyAppliedEncodeUsingFirstHeaders[T] extends AnyVal
- final class PartiallyAppliedEncodeWithoutHeaders[T] extends AnyVal
- trait PlatformCellDecoders extends AnyRef
- trait PlatformCellEncoders extends AnyRef
- sealed trait QuoteHandling extends AnyRef
- type Row = RowF[NoneF, Nothing]
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 asmap
,emap
, orflatMap
to build new decoders out of more basic one.Actually,
RowDecoder
has a catsMonadError
instance. To get the full power of it, importcats.syntax.all._
.- Annotations
- @implicitNotFound()
- trait RowDecoderF[H[+a] <: Option[a], T, Header] extends AnyRef
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 asmap
,emap
, orflatMap
to build new decoders out of more basic one.Actually,
RowDecoderF
has a catsMonadError
instance. To get the full power of it, importcats.syntax.all._
.- Annotations
- @FunctionalInterface()
- 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.
- Annotations
- @implicitNotFound()
- trait RowEncoderF[H[+a] <: Option[a], T, Header] extends AnyRef
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.
- Annotations
- @implicitNotFound() @FunctionalInterface()
- case class RowF[H[+a] <: Option[a], Header](values: NonEmptyList[String], headers: H[NonEmptyList[Header]], line: Option[Long] = None) extends Product with Serializable
A CSV row with or without headers.
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
andheaders
have the same size if headers are present. - trait WriteableHeader[Header] extends AnyRef
Value Members
- def decodeGivenHeaders[T]: PartiallyAppliedDecodeGivenHeaders[T]
Decode a char-like stream (see fs2.data.text.CharLikeChunks) into a specified type.
Decode a char-like stream (see fs2.data.text.CharLikeChunks) into a specified type.
Scenarios: - If skipHeaders is false, then the file contains no headers. - If skipHeaders is true, then the headers in the file will be skipped.
For both scenarios the file is assumed to be compliant with the set of headers given.
- def decodeSkippingHeaders[T]: PartiallyAppliedDecodeSkippingHeaders[T]
Decode a char-like stream (see fs2.data.text.CharLikeChunks) into a specified type, assuming the file contains headers, but they shall be skipped for decoding.
- def decodeUsingHeaders[T]: PartiallyAppliedDecodeUsingHeaders[T]
Decode a char-like stream (see fs2.data.text.CharLikeChunks) into a specified type, assuming the file contains headers and they need to be taken into account for decoding.
- def decodeWithoutHeaders[T]: PartiallyAppliedDecodeWithoutHeaders[T]
Decode a char-like stream (see fs2.data.text.CharLikeChunks) into a specified type, assuming the file neither contains headers nor are they needed for decoding.
- def encodeGivenHeaders[T]: PartiallyAppliedEncodeGivenHeaders[T]
Encode a specified type into a CSV prepending the given headers.
- def encodeUsingFirstHeaders[T]: PartiallyAppliedEncodeUsingFirstHeaders[T]
Encode a specified type into a CSV that contains the headers determined by encoding the first element.
Encode a specified type into a CSV that contains the headers determined by encoding the first element. Empty if input is.
- def encodeWithoutHeaders[T]: PartiallyAppliedEncodeWithoutHeaders[T]
Encode a specified type into a CSV that contains no headers.
- object CellDecoder extends CellDecoderInstances1 with CellDecoderInstances2 with LiteralCellDecoders with ExportedCellDecoders with PlatformCellDecoders
- object CellEncoder extends CellEncoderInstances1 with CellEncoderInstances2 with LiteralCellEncoders with EnumEncoders with ExportedCellEncoders with PlatformCellEncoders
- object CsvRow
- object CsvRowDecoder
- object CsvRowEncoder
- object EscapeMode
- object HasHeaders
- object ParseableHeader
- object QuoteHandling
- 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 asmap
,emap
, orflatMap
to build new decoders out of more basic one.Actually,
RowDecoder
has a catsMonadError
instance. To get the full power of it, importcats.syntax.all._
. - object RowDecoderF extends ExportedRowDecoderFs
- object RowEncoder
- object RowEncoderF extends ExportedRowEncoderFs
- object RowF extends Serializable
- object WriteableHeader
- object lenient
- object lowlevel
Low level pipes for CSV handling.
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.