Java-only stuff
Java-only stuff
Various generally useful utilities
Various generally useful utilities
Read and write CSV/TSV. Portable: the parser and writer are plain Clojure operating on strings and vectors, so they work identically in Clojure and ClojureScript. Clojure also gets convenience fns for reading from files, classpath resources, and urls (anything clojure.java.io/reader accepts), and for writing to files.
Two shapes in and out:
Synthesized from the various copies of this floating around (voracious, traverse): numeric coercion, :__id for a blank header, and BOM-stripping on file reads all came from there. Their :quote? auto-quote-numeric-looking-strings-on-write trick was dropped -- it was marked broken in both sources and rows->str's ordinary auto-quoting covers real needs.
Read and write CSV/TSV. Portable: the parser and writer are plain Clojure operating on strings and vectors, so they work identically in Clojure and ClojureScript. Clojure also gets convenience fns for reading from files, classpath resources, and urls (anything clojure.java.io/reader accepts), and for writing to files. Two shapes in and out: - raw: a seq of rows, each row a vector of string fields (first row usually a header). Always plain strings, untouched. - ms (mapseq): a seq of maps, keyed from the header row -- see hyperphor.multitool.data. Values are lightly coerced (empty field -> nil, otherwise numeric strings -> numbers) since that's almost always what you want out of a mapseq; pass :strings? true to keep everything as strings. Synthesized from the various copies of this floating around (voracious, traverse): numeric coercion, :__id for a blank header, and BOM-stripping on file reads all came from there. Their :quote? auto-quote-numeric-looking-strings-on-write trick was dropped -- it was marked broken in both sources and rows->str's ordinary auto-quoting covers real needs.
Utility functions for development only
Utility functions for development only
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |