Types
DumpContext = ref object header*: seq[string] data*: string lineEnd*: string separator*: string quote*: char
- Source Edit
ParseContext = ref object i*: int header*: seq[string] data*: string lineEnd*: string separator*: string
- Context for parsing CSV/TSV. Source Edit
TabbyError = object of ValueError
- Source Edit
Procs
proc dumpHook(d: DumpContext; v: string) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc dumpHook[T](d: DumpContext; v: T)
- Source Edit
proc fromCsvFast[T](data: string; objType: type[seq[T]]; hasHeader = true; lineEnd = "\n"; separator = ","): seq[T]
-
Read data seq as a CSV. Objects schema must match CSV schema.
- hasHeader - should header be skipped. will be skipped if header is set.
proc fromCsvGuess[T](data: string; objType: type[seq[T]]; header = newSeq[string](); hasHeader = true): seq[T]
- Read data seq as a CSV. Tries to guess what separators or lineEnds are used. Source Edit
proc parseHook(p: ParseContext; name: string; v: var bool) {....raises: [], tags: [], forbids: [].}
- Parse hook for boolean. Source Edit
proc parseHook(p: ParseContext; name: string; v: var SomeFloat)
- Parse hook for float point number. Source Edit
proc parseHook(p: ParseContext; name: string; v: var SomeInteger)
- Parse hook for integer number. Source Edit
proc parseHook(p: ParseContext; name: string; v: var string) {....raises: [], tags: [], forbids: [].}
- Parse hook for string. Source Edit
proc parseHook[T: enum](p: ParseContext; name: string; v: var T)
- Parse hook for boolean. Source Edit
Templates
template fieldPairs3(x: untyped): untyped
- Helper to iterate over fields of ref object. Source Edit