CSV
io.github.quafadas.scautable.CSV
object CSV
Attributes
- Experimental
- true
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CSV.type
Members list
Type members
Classlikes
object CSVParser
According to chatGPT will parse RFC 4180 compliant CSV.
According to chatGPT will parse RFC 4180 compliant CSV.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CSVParser.type
class CsvIterator[K](filePath: String) extends Iterator[NamedTuple[K & Tuple, StringyTuple[K & Tuple]]]
Attributes
- Supertypes
-
trait IterableOnceOps[NamedTuple[K & Tuple, StringyTuple[K & Tuple]], Iterator, Iterator[NamedTuple[K & Tuple, StringyTuple[K & Tuple]]]]class Objecttrait Matchableclass AnyShow all
Types
type AllAreColumns[T <: Tuple, K <: Tuple] = T match { case EmptyTuple => true case head *: tail => IsColumn[head, K] match { case true => AllAreColumns[tail, K] case false => false } }
type DropAfterName[T, StrConst <: String] = T match { case EmptyTuple => EmptyTuple case head *: tail => IsMatch[StrConst, head] match { case true => EmptyTuple case false => head *: DropAfterName[tail, StrConst] } }
type DropOneName[T, StrConst <: String] = T match { case EmptyTuple => EmptyTuple case head *: tail => IsMatch[StrConst, head] match { case true => DropOneName[tail, StrConst] case false => head *: DropOneName[tail, StrConst] } }
type DropOneTypeAtName[N <: Tuple, StrConst <: String, T <: Tuple] = (N, T) match { case (EmptyTuple, _$21) => EmptyTuple case (_$22, EmptyTuple) => EmptyTuple case (nameHead *: nameTail, typeHead *: typeTail) => IsMatch[nameHead, StrConst] match { case true => typeTail case false => typeHead *: DropOneTypeAtName[nameTail, StrConst, typeTail] } }
type GetTypeAtName[N <: Tuple, StrConst <: String, T <: Tuple] = (N, T) match { case (EmptyTuple, _$23) => EmptyTuple case (_$24, EmptyTuple) => EmptyTuple case (nameHead *: nameTail, typeHead *: typeTail) => IsMatch[nameHead, StrConst] match { case true => typeHead case false => GetTypeAtName[nameTail, StrConst, typeTail] } }
type GetTypesAtNames[N <: Tuple, ForNames <: Tuple, T <: Tuple] = ForNames match { case EmptyTuple => EmptyTuple case nameHead *: nameTail => GetTypeAtName[N, nameHead, T] *: GetTypesAtNames[N, nameTail, T] }
type NumericColsIdx[T <: Tuple] = T match { case EmptyTuple => EmptyTuple case head *: tail => IsNumeric[head] match { case true => true *: NumericColsIdx[tail] case false => false *: NumericColsIdx[tail] } }
type ReReverseXLL[t] = Size[t] match { case 0 => EmptyTuple case 1 => t case 2 => t case 3 => t case 4 => t case 5 => t case 6 => t case 7 => t case 8 => t case 9 => t case 10 => t case 11 => t case 12 => t case 13 => t case 14 => t case 15 => t case 16 => t case 17 => t case 18 => t case 19 => t case 20 => t case 21 => t case 22 => t case Any => ReverseTuple[t] }
type ReplaceOneName[T <: Tuple, StrConst <: String, A <: String] = T match { case EmptyTuple => EmptyTuple case nameHead *: nameTail => IsMatch[nameHead, StrConst] match { case true => A *: nameTail case false => nameHead *: ReplaceOneName[nameTail, StrConst, A] } }
type ReplaceOneTypeAtName[N <: Tuple, StrConst <: String, T <: Tuple, A] = (N, T) match { case (EmptyTuple, _$19) => EmptyTuple case (_$20, EmptyTuple) => EmptyTuple case (nameHead *: nameTail, typeHead *: typeTail) => IsMatch[nameHead, StrConst] match { case true => A *: typeTail case false => typeHead *: ReplaceOneTypeAtName[nameTail, StrConst, typeTail, A] } }
type ReverseTuple[T <: Tuple] = T match { case EmptyTuple => EmptyTuple case x *: xs => ReverseTuple[xs] *: x }
type SelectFromTuple[T <: Tuple, Bools <: Tuple] = T match { case EmptyTuple => EmptyTuple case head *: tail => Bools match { case true *: boolTail => head *: SelectFromTuple[tail, boolTail] case false *: boolTail => SelectFromTuple[tail, boolTail] } }
type StringifyTuple[T >: Tuple] = T match { case EmptyTuple => EmptyTuple case head *: tail => NamedTuple[Tuple1["head"], Tuple1[String]] *: StringifyTuple[tail] }
type StringyTuple[T <: Tuple] = T match { case EmptyTuple => EmptyTuple case head *: tail => String *: StringyTuple[tail] }
type TupleContainsIdx[Search <: Tuple, In <: Tuple] = In match { case EmptyTuple => EmptyTuple case head *: tail => Search match { case EmptyTuple => false *: EmptyTuple case searchHead *: searchTail => IsColumn[head, Search] match { case true => true *: TupleContainsIdx[Search, tail] case false => false *: TupleContainsIdx[Search, tail] } } }
Value members
Concrete methods
Givens
Givens
Extensions
Extensions
extension [K, V, K1 <: Tuple & K, V1 <: Tuple & K](itr: Iterator[NamedTuple[K1, V1]])
inline def addColumn[S <: String, A](fct: NamedTuple[K1, V1] => A): Iterator[NamedTuple[S *: K1, A *: V1]]
inline def column[S <: String](using ev: IsColumn[S, K1] =:= true, s: ValueOf[S]): Iterator[GetTypeAtName[K1, S, V1]]
inline def columns[ST <: Tuple](using ev: AllAreColumns[ST, K1] =:= true): Iterator[NamedTuple[SelectFromTuple[K1, TupleContainsIdx[ST, K1]], GetTypesAtNames[K1, SelectFromTuple[K1, TupleContainsIdx[ST, K1]], V1]]]
inline def dropColumn[S <: String](using ev: IsColumn[S, K1] =:= true, s: ValueOf[S]): Iterator[NamedTuple[DropOneName[K1, S], DropOneTypeAtName[K1, S, V1]]]
inline def forceColumnType[S <: String, A]: Iterator[NamedTuple[K1, ReplaceOneTypeAtName[K1, S, V1, A]]]
inline def mapColumn[S <: String, A](fct: GetTypeAtName[K1, S, V1] => A)(using ev: IsColumn[S, K1] =:= true, s: ValueOf[S]): Iterator[NamedTuple[K1, ReplaceOneTypeAtName[K1, S, V1, A]]]
inline def numericColSummary[S <: String](using ev: IsColumn[S, K1] =:= true, isNum: IsNumeric[GetTypeAtName[K1, S, V1]] =:= true, s: ValueOf[S], a: Fractional[GetTypeAtName[K1, S, V1]]): NamedTuple[("mean", "std", "min", "25%", "50%", "75%", "max"), (GetTypeAtName[K1, S, V1], Double, GetTypeAtName[K1, S, V1], Double, Double, Double, GetTypeAtName[K1, S, V1])]
inline def renameColumn[From <: String, To <: String](using ev: IsColumn[From, K1] =:= true, FROM: ValueOf[From], TO: ValueOf[To]): Iterator[NamedTuple[ReplaceOneName[K1, From, To], V1]]
inline def resolveNT[ST <: Tuple]: NamedTuple[SelectFromTuple[K1, TupleContainsIdx[ST, K1]], GetTypesAtNames[K1, SelectFromTuple[K1, TupleContainsIdx[ST, K1]], V1]]
inline def resolveT[ST <: Tuple]: GetTypesAtNames[K1, SelectFromTuple[K1, TupleContainsIdx[ST, K1]], V1]
extension [K <: Tuple, V <: Tuple](nt: Seq[NamedTuple[K, V]])
inline def columns[ST <: Tuple](using ev: AllAreColumns[ST, K] =:= true): Seq[NamedTuple[SelectFromTuple[K, TupleContainsIdx[ST, K]], GetTypesAtNames[K, SelectFromTuple[K, TupleContainsIdx[ST, K]], V]]]
inline def dropColumn[S <: String](using ev: IsColumn[S, K] =:= true, s: ValueOf[S]): Seq[NamedTuple[DropOneName[K, S], DropOneTypeAtName[K, S, V]]]
inline def mapColumn[S <: String, A](fct: GetTypeAtName[K, S, V] => A)(using ev: IsColumn[S, K] =:= true, s: ValueOf[S]): Seq[NamedTuple[K, ReplaceOneTypeAtName[K, S, V, A]]]
inline def renameColumn[From <: String, To <: String](using ev: IsColumn[From, K] =:= true, FROM: ValueOf[From], TO: ValueOf[To]): Seq[NamedTuple[ReplaceOneName[K, From, To], V]]
In this article