Input and Output processors.
Input and Output processors.
(csv)
(csv spec)
(csv spec source)
Accepts map, creates CSV spec, good for reading and writing.
:field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :delimiter |X|X| , | Field delimiter, char or String. :strict |X| | true | Fail in malformed input? Boolean. :eol | |X| Env line.separator | End Of Line, char or String. :quote-char |X|X| " | Quote character, char. :force-quote | |X| false | Quote ALL fields. Boolean. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.
Invoking (csv) produces default spec.
Accepts map, creates CSV spec, good for reading and writing. :field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :delimiter |X|X| \, | Field delimiter, char or String. :strict |X| | true | Fail in malformed input? Boolean. :eol | |X| Env line.separator | End Of Line, char or String. :quote-char |X|X| \" | Quote character, char. :force-quote | |X| false | Quote ALL fields. Boolean. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider. Invoking (csv) produces default spec.
(edn)
(edn spec)
(edn spec source)
Accepts map, creates EDN spec, good for reading and writing.
:field |R|W| Default | Description -------------+-+-+----------------------+------------------------------------ :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :processor |X| | vec | Your callable. :readers |X| | nil | Custom readers for clojure.edn. :default |X| | vector | Default callable for tag+value. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.
Invoking (edn) produces default spec.
Accepts map, creates EDN spec, good for reading and writing. :field |R|W| Default | Description -------------+-+-+----------------------+------------------------------------ :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :processor |X| | vec | Your callable. :readers |X| | nil | Custom readers for clojure.edn. :default |X| | vector | Default callable for tag+value. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider. Invoking (edn) produces default spec.
(fast-hasher)
(fast-hasher spec)
(fast-hasher spec source)
Accepts map, creates FastHasher spec, good for reading.
:field |R|W| Default | Description --------------+-+-+---------------------+------------------------------------ :skip-bytes |X| | 0 | Skip bytes, non-negative int. :sample-size |X| | :full | How many bytes, :full or pos. int. :input-stream |X| | c.j.io/input-stream | InputStream provider.
Accepts map, creates FastHasher spec, good for reading. :field |R|W| Default | Description --------------+-+-+---------------------+------------------------------------ :skip-bytes |X| | 0 | Skip bytes, non-negative int. :sample-size |X| | :full | How many bytes, :full or pos. int. :input-stream |X| | c.j.io/input-stream | InputStream provider.
(files)
(files spec)
(files spec source)
Accepts map, creates Files spec, good for reading.
:field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :follow? | |X| (constantly true) | Keep? Predicate: File -> Boolean. :processor |X| | vec | Your callable.
Invoking (files) produces default spec.
Accepts map, creates Files spec, good for reading. :field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :follow? | |X| (constantly true) | Keep? Predicate: File -> Boolean. :processor |X| | vec | Your callable. Invoking (files) produces default spec.
(fixed-width)
(fixed-width spec)
(fixed-width spec source)
Accepts map, creates FixedWidth spec, good for reading and writing.
:field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :eol | |X| Env line.separator | End Of Line, char or String. :strict |X| | true | Fail in malformed input? Boolean. :widths [X|X] [1] | Slice sizes, vec of positive ints. :final-eol |X|X| false | EOL at the end of output? Boolean. :fill-char | |X| \space | Right fill character, char. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.
Invoking (fixed-width) produces default spec (with: {:widths [1]}).
Accepts map, creates FixedWidth spec, good for reading and writing. :field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :eol | |X| Env line.separator | End Of Line, char or String. :strict |X| | true | Fail in malformed input? Boolean. :widths [X|X] [1] | Slice sizes, vec of positive ints. :final-eol |X|X| false | EOL at the end of output? Boolean. :fill-char | |X| \space | Right fill character, char. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider. Invoking (fixed-width) produces default spec (with: {:widths [1]}).
(gzip-input-stream file-like & opts)
Return output-stream with GZIPInputStream within.
Return output-stream with GZIPInputStream within.
(gzip-output-stream file-like & opts)
Return output-stream with GZIPOutputStream within.
Return output-stream with GZIPOutputStream within.
(gzip-reader file-like & opts)
Return reader with GZIPInputStream within.
Return reader with GZIPInputStream within.
(gzip-writer file-like & opts)
Return writer with GZIPOutputStream within.
Return writer with GZIPOutputStream within.
(hasher)
(hasher spec)
(hasher spec source)
Accepts map, creates Hasher spec, good for reading.
:field |R|W| Default | Description --------------+-+-+---------------------+------------------------------------ :hash-name |X| | SHA-256 | Hash algo name. :skip-bytes |X| | 0 | Skip bytes, non-negative int. :sample-size |X| | :full | How many bytes, :full or pos. int. :input-stream |X| | c.j.io/input-stream | InputStream provider.
Accepts map, creates Hasher spec, good for reading. :field |R|W| Default | Description --------------+-+-+---------------------+------------------------------------ :hash-name |X| | SHA-256 | Hash algo name. :skip-bytes |X| | 0 | Skip bytes, non-negative int. :sample-size |X| | :full | How many bytes, :full or pos. int. :input-stream |X| | c.j.io/input-stream | InputStream provider.
Protocol for getting data from source.
Protocol for getting data from source.
(in! spec source)
Read source, feed data to processor, return result.
Read source, feed data to processor, return result.
(lines)
(lines spec)
(lines spec source)
Accepts map, creates Lines spec, good for reading and writing.
:field |R|W| Default | Description -----------+-+-+--------------------+--------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :eol | |X| Env line.separator | End Of Line, char or String. :append | |X| false | Append to file? Boolean. :final-eol | |X| false | EOL at the end of output? Boolean. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.
Invoking (lines) produces default spec.
Accepts map, creates Lines spec, good for reading and writing. :field |R|W| Default | Description -----------+-+-+--------------------+--------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :eol | |X| Env line.separator | End Of Line, char or String. :append | |X| false | Append to file? Boolean. :final-eol | |X| false | EOL at the end of output? Boolean. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider. Invoking (lines) produces default spec.
Protocol for putting data to target.
Protocol for putting data to target.
(sink spec target)
Returned callable will eat seq and write to target.
Returned callable will eat seq and write to target.
(pass-through-writer a-writer & opts)
Return a function passing over provided writer. Like a StringWriter.
Return a function passing over provided writer. Like a StringWriter.
(paths)
(paths spec)
(paths spec source)
Accepts map, creates Paths spec, good for reading.
:field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :follow? | |X| (constantly true) | Keep? Predicate: Path -> Boolean. :processor |X| | vec | Your callable.
Invoking (paths) produces default spec.
Accepts map, creates Paths spec, good for reading. :field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :follow? | |X| (constantly true) | Keep? Predicate: Path -> Boolean. :processor |X| | vec | Your callable. Invoking (paths) produces default spec.
(pruning-file-seq entry)
(pruning-file-seq entry follow?)
Like file-seq, but can prune files and directories based on predicate.
If follow?
returns false - file/directory is not processed, nor entered.
Predicate will be first executed on given entry.
If predicate not given it just calls file-seq.
Why?
Ever went into a massive .svn directory? Now you can have tree-seq that prunes the entire path of enquiry and moves on. Pretty nice!
Like file-seq, but can prune files and directories based on predicate. If `follow?` returns false - file/directory is not processed, nor entered. Predicate will be first executed on given entry. If predicate not given it just calls file-seq. Why? Ever went into a massive .svn directory? Now you can have tree-seq that prunes the entire path of enquiry and moves on. Pretty nice!
Those who can't spell - shim.
Those who can't spell - shim.
(string-reader a-string & opts)
Return a function providing StringReader over a given String.
Return a function providing StringReader over a given String.
(tsv)
(tsv spec)
(tsv spec source)
Accepts map, creates TSV spec, good for reading and writing.
This constructor delegates to csv, changes only :delimiter.
Invoking (tsv) produces default spec.
Accepts map, creates TSV spec, good for reading and writing. This constructor delegates to csv, changes only :delimiter. Invoking (tsv) produces default spec.
(xml)
(xml spec)
(xml spec source)
Accepts map, creates XML spec, good for reading and writing.
:field |R|W| Default | Description -------------+-+-+----------------------+------------------------------------ :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :processor |X| | szew.io/xml-realizer | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.
Invoking (xml) produces default spec.
Tips:
Accepts map, creates XML spec, good for reading and writing. :field |R|W| Default | Description -------------+-+-+----------------------+------------------------------------ :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :processor |X| | szew.io/xml-realizer | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider. Invoking (xml) produces default spec. Tips: 1. Uses clojure.data.xml/parse and clojure.data.xml/emit 2. Feed to clojure.zip/xml-zip first 3. clojure.data.zip.xml next: xml->, attr=, attr, :tag, tag=, text & text= 4. clojure.zip/node within! xml-> will extract whole loc from zip 5. xml-> returns sequence of matches.
(xml-realizer parsed-xml)
Get parsed XML, touch every node, return head.
Get parsed XML, touch every node, return head.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close