-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documented csv.lisp and added documentation as a html file.
* Removed markdown * Used Edi Weitz's template generation
- Loading branch information
pdn
committed
Feb 11, 2012
1 parent
7f5ce1c
commit 377e201
Showing
3 changed files
with
413 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,339 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | ||
<html> | ||
|
||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | ||
<title>A common lisp library providing easy csv reading and writing.</title> | ||
<style type="text/css"> | ||
pre { padding:5px; background-color:#e0e0e0 } | ||
h3, h4 { text-decoration: underline; } | ||
a { text-decoration: none; padding: 1px 2px 1px 2px; } | ||
a:visited { text-decoration: none; padding: 1px 2px 1px 2px; } | ||
a:hover { text-decoration: none; padding: 1px 1px 1px 1px; border: 1px solid #000000; } | ||
a:focus { text-decoration: none; padding: 1px 2px 1px 2px; border: none; } | ||
a.none { text-decoration: none; padding: 0; } | ||
a.none:visited { text-decoration: none; padding: 0; } | ||
a.none:hover { text-decoration: none; border: none; padding: 0; } | ||
a.none:focus { text-decoration: none; border: none; padding: 0; } | ||
a.noborder { text-decoration: none; padding: 0; } | ||
a.noborder:visited { text-decoration: none; padding: 0; } | ||
a.noborder:hover { text-decoration: none; border: none; padding: 0; } | ||
a.noborder:focus { text-decoration: none; border: none; padding: 0; } | ||
pre.none { padding:5px; background-color:#ffffff } | ||
</style> | ||
</head> | ||
|
||
<body bgcolor=white> | ||
|
||
<h2> CL-CSV - a Common Lisp library for csv reading and writing</h2> | ||
|
||
<blockquote> | ||
<br> <br><h3><a name=abstract class=none>Abstract</a></h3> | ||
|
||
<p> | ||
A common lisp library providing easy csv reading and writing. | ||
<p> | ||
The code license is found <a href="https://github.com/AccelerationNet/cl-csv/blob/master/LICENSE"> here</a>. | ||
|
||
|
||
|
||
<br> <br><h3><a class=none name="contents">Contents</a></h3> | ||
<ol> | ||
<li><a href="#download">Download</a> | ||
<li><a href="#dictionary">The CL-CSV dictionary</a> | ||
<ol> | ||
<li><a href="#*default-external-format*"><code>*default-external-format*</code></a> | ||
<li><a href="#*newline*"><code>*newline*</code></a> | ||
<li><a href="#*quote*"><code>*quote*</code></a> | ||
<li><a href="#*quote-escape*"><code>*quote-escape*</code></a> | ||
<li><a href="#*separator*"><code>*separator*</code></a> | ||
<li><a href="#csv-parse-error"><code>csv-parse-error</code></a> | ||
<li><a href="#csv-parse-error"><code>csv-parse-error</code></a> | ||
<li><a href="#do-csv"><code>do-csv</code></a> | ||
<li><a href="#format-csv-value"><code>format-csv-value</code></a> | ||
<li><a href="#read-csv"><code>read-csv</code></a> | ||
<li><a href="#read-csv-row"><code>read-csv-row</code></a> | ||
<li><a href="#write-csv"><code>write-csv</code></a> | ||
<li><a href="#write-csv-row"><code>write-csv-row</code></a> | ||
<li><a href="#write-csv-value"><code>write-csv-value</code></a> | ||
</ol> | ||
<li><a href="#ack">Acknowledgements</a> | ||
</ol> | ||
|
||
<br> <br><h3><a class=none name="download">Download</a></h3> | ||
|
||
CL-CSV together with this documentation can be downloaded from <a | ||
href="https://github.com/AccelerationNet/cl-csv">https://github.com/AccelerationNet/cl-csv</a>. | ||
|
||
<br> <br><h3><a class=none name="dictionary">The CL-CSV dictionary</a></h3> | ||
|
||
|
||
|
||
<!-- Entry for *DEFAULT-EXTERNAL-FORMAT* --> | ||
|
||
<p><br>[Special variable]<br><a class=none name='*default-external-format*'><b>*default-external-format*</b></a> | ||
<blockquote><br> | ||
|
||
the external format used for opening files | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for *DEFAULT-EXTERNAL-FORMAT* --> | ||
|
||
|
||
<!-- Entry for *NEWLINE* --> | ||
|
||
<p><br>[Special variable]<br><a class=none name='*newline*'><b>*newline*</b></a> | ||
<blockquote><br> | ||
|
||
Default newline string | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for *NEWLINE* --> | ||
|
||
|
||
<!-- Entry for *QUOTE* --> | ||
|
||
<p><br>[Special variable]<br><a class=none name='*quote*'><b>*quote*</b></a> | ||
<blockquote><br> | ||
|
||
Default quote character | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for *QUOTE* --> | ||
|
||
|
||
<!-- Entry for *QUOTE-ESCAPE* --> | ||
|
||
<p><br>[Special variable]<br><a class=none name='*quote-escape*'><b>*quote-escape*</b></a> | ||
<blockquote><br> | ||
|
||
Default setting for escaping quotes | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for *QUOTE-ESCAPE* --> | ||
|
||
|
||
<!-- Entry for *SEPARATOR* --> | ||
|
||
<p><br>[Special variable]<br><a class=none name='*separator*'><b>*separator*</b></a> | ||
<blockquote><br> | ||
|
||
Default separator character | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for *SEPARATOR* --> | ||
|
||
|
||
<!-- Entry for CSV-PARSE-ERROR --> | ||
|
||
<p><br>[Condition type]<br><a class=none name='csv-parse-error'><b>csv-parse-error</b></a> | ||
<blockquote><br> | ||
|
||
|
||
|
||
</blockquote> | ||
|
||
<!-- End of entry for CSV-PARSE-ERROR --> | ||
|
||
|
||
<!-- Entry for CSV-PARSE-ERROR --> | ||
|
||
<p><br>[Function]<br><a class=none name='csv-parse-error'><b>csv-parse-error</b> <i>msg <tt>&rest</tt> args</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
|
||
|
||
</blockquote> | ||
|
||
<!-- End of entry for CSV-PARSE-ERROR --> | ||
|
||
|
||
<!-- Entry for DO-CSV --> | ||
|
||
<p><br>[Macro]<br><a class=none name='do-csv'><b>do-csv</b> <i>(row-var stream-or-pathname <tt>&rest</tt> read-csv-keys) declaration* statement*</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
<p>row-var: a variable that is passed into _body_ | ||
|
||
<p>stream-or-pathname: a stream or a pathname to read the CSV data from | ||
|
||
<p>read-csv-keys: keys and values passed to the _read-csv_ function | ||
|
||
<p>body: body of the macro | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for DO-CSV --> | ||
|
||
|
||
<!-- Entry for FORMAT-CSV-VALUE --> | ||
|
||
<p><br>[Generic function]<br><a class=none name='format-csv-value'><b>format-csv-value</b> <i>val</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
|
||
|
||
</blockquote> | ||
|
||
<!-- End of entry for FORMAT-CSV-VALUE --> | ||
|
||
|
||
<!-- Entry for FORMAT-CSV-VALUE --> | ||
|
||
<p><br>[Method]<br><a class=none><b>format-csv-value</b> <i>val</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
Print values in ways that are most cross compatible with the csv format | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for FORMAT-CSV-VALUE --> | ||
|
||
|
||
<!-- Entry for READ-CSV --> | ||
|
||
<p><br>[Function]<br><a class=none name='read-csv'><b>read-csv</b> <i>stream-or-string <tt>&key</tt> row-fn map-fn sample skip-first-p (separator *separator*) (quote *quote*) (escape *quote-escape*)</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
<P>Read in a CSV by data-row (which due to quoted newlines may be more | ||
than one line from the stream) | ||
|
||
<p>row-fn: passing this parameter will cause this read to be streaming | ||
and results will be discarded after the row-fn is called | ||
with data | ||
|
||
<p>map-fn: used for manipulating the data by row during collection if | ||
specified; (funcall map-fn data) is collected instead of data | ||
|
||
<p>sample: when a positive integer, only take that many samples from the input file | ||
|
||
<p>skip-first-p: when true, skips the first line in the csv | ||
|
||
<P>Keywords: | ||
|
||
<p>separator: character separating between data cells. Defaults to *separator* | ||
|
||
<p>quote: quoting character for text strings. Defaults to *quote* | ||
|
||
<p>escape: escape character. Defaults to *quote-escape* | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for READ-CSV --> | ||
|
||
|
||
<!-- Entry for READ-CSV-ROW --> | ||
|
||
<p><br>[Function]<br><a class=none name='read-csv-row'><b>read-csv-row</b> <i>stream-or-string <tt>&key</tt> (separator *separator*) (quote *quote*) (escape *quote-escape*) <tt>&aux</tt> current state line llen c elen</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
Read in a CSV by data-row (which due to quoted newlines may be more than one | ||
line from the stream) | ||
|
||
|
||
</blockquote> | ||
|
||
<!-- End of entry for READ-CSV-ROW --> | ||
|
||
|
||
<!-- Entry for WRITE-CSV --> | ||
|
||
<p><br>[Function]<br><a class=none name='write-csv'><b>write-csv</b> <i>rows-of-items <tt>&key</tt> stream (separator *separator*) (quote *quote*) (escape *quote-escape*) (newline *newline*) (always-quote *always-quote*)</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
<P>Writes a CSV | ||
|
||
<p>rows-of-items: iterable | ||
|
||
<P>Keywords: | ||
|
||
<p>stream: stream to write to. Default: nil. | ||
|
||
<p>quote: quoting character. Defaults to *quote* | ||
|
||
<p>escape: escaping character. Defaults to *quote-escape* | ||
|
||
<p>newline: newline character. Defaults to *newline* | ||
|
||
<p>always-quote: Defaults to *always-quote* | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for WRITE-CSV --> | ||
|
||
|
||
<!-- Entry for WRITE-CSV-ROW --> | ||
|
||
<p><br>[Function]<br><a class=none name='write-csv-row'><b>write-csv-row</b> <i>items <tt>&key</tt> stream (separator *separator*) (quote *quote*) (escape *quote-escape*) (newline *newline*) (always-quote *always-quote*)</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
<p>Writes a list items to stream | ||
|
||
<p>rows-of-items: iterable | ||
|
||
<p>Keywords: | ||
|
||
<p>stream: stream to write to. Default: nil. | ||
|
||
<p>quote: quoting character. Defaults to *quote* | ||
|
||
<p>escape: escaping character. Defaults to *quote-escape* | ||
|
||
<p>newline: newline character. Defaults to *newline* | ||
|
||
<p>always-quote: Defaults to *always-quote* | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for WRITE-CSV-ROW --> | ||
|
||
|
||
<!-- Entry for WRITE-CSV-VALUE --> | ||
|
||
<p><br>[Generic function]<br><a class=none name='write-csv-value'><b>write-csv-value</b> <i>val csv-stream <tt>&key</tt> formatter quote separator escape always-quote</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
|
||
|
||
</blockquote> | ||
|
||
<!-- End of entry for WRITE-CSV-VALUE --> | ||
|
||
|
||
<!-- Entry for WRITE-CSV-VALUE --> | ||
|
||
<p><br>[Method]<br><a class=none><b>write-csv-value</b> <i>val csv-stream <tt>&key</tt> formatter quote separator escape always-quote</i> => <i>result</i></a> | ||
<blockquote><br> | ||
|
||
<p>Writes val to csv-stream in a formatted fashion. | ||
|
||
<p>Keywords: | ||
|
||
<p>formatter: used to format val. Defaults to format-csv-value. | ||
|
||
<p>quote: quoting character. Defaults to *quote* | ||
|
||
<p>escape: escaping character. Defaults to *quote-escape* | ||
|
||
<p>newline: newline character. Defaults to *newline* | ||
|
||
<p>always-quote: Defaults to *always-quote* | ||
|
||
</blockquote> | ||
|
||
<!-- End of entry for WRITE-CSV-VALUE --> | ||
|
||
|
||
<br> <br><h3><a class=none name="ack">Acknowledgements</a></h3> | ||
|
||
<p> | ||
This documentation was prepared with <a href="http://weitz.de/documentation-template/">DOCUMENTATION-TEMPLATE</a>. | ||
</p> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.