Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libcsv.tex @ 28835:98e31cfd26dc legacy-trunk
reflect csv's change back to a module. Document the new sniffer api.
| author | Skip Montanaro <skip@pobox.com> |
|---|---|
| date | Fri, 25 Apr 2003 15:14:49 +0000 |
| parents | 21633e9df8cc |
| children | 1bef3eca20ce |
line wrap: on
line diff
--- a/Doc/lib/libcsv.tex Fri Apr 25 15:12:47 2003 +0000 +++ b/Doc/lib/libcsv.tex Fri Apr 25 15:14:49 2003 +0000 @@ -19,18 +19,18 @@ single module which can efficiently manipulate such data, hiding the details of reading and writing the data from the programmer. -The \module{csv} package implements classes to read and write tabular data in +The \module{csv} module implements classes to read and write tabular data in CSV format. It allows programmers to say, ``write this data in the format preferred by Excel,'' or ``read data from this file which was generated by Excel,'' without knowing the precise details of the CSV format used by Excel. Programmers can also describe the CSV formats understood by other applications or define their own special-purpose CSV formats. -The \module{csv} package's \class{reader} and \class{writer} objects read and +The \module{csv} module's \class{reader} and \class{writer} objects read and write sequences. Programmers can also read and write data in dictionary form using the \class{DictReader} and \class{DictWriter} classes. -\note{The first version of the \module{csv} package doesn't support Unicode +\note{The first version of the \module{csv} module doesn't support Unicode input. Also, there are currently some issues regarding \ASCII{} NUL characters. Accordingly, all input should generally be printable \ASCII{} to be safe. These restrictions will be removed in the future.} @@ -43,10 +43,10 @@ \end{seealso} -\subsection{Package Contents} +\subsection{Module Contents} -The \module{csv} package defines the following functions: +The \module{csv} module defines the following functions: \begin{funcdesc}{reader}{csvfile\optional{, dialect=\code{'excel'}\optional{, fmtparam}}} @@ -109,7 +109,7 @@ \end{funcdesc} -The \module{csv} package defines the following classes: +The \module{csv} module defines the following classes: \begin{classdesc}{DictReader}{csvfile, fieldnames\optional{, restkey=\code{None}\optional{, @@ -263,24 +263,18 @@ \end{methoddesc} -\subsection{Submodule \code{utils}} +\begin{classdesc}{Sniffer}{} -The \module{csv} package contains a \module{utils} submodule which defines -the following class. - -\begin{classdesc}{Sniffer}{\optional{sample=16384}} +The \class{Sniffer} class is used to deduce the format of a CSV file. -The \class{Sniffer} class is used to deduce the format of a CSV file. The -optional \var{sample} argument to the constructor specifies the number of -bytes to use when determining Dialect parameters. - -\begin{methoddesc}{sniff}{fileobj} -Analyze the next chunk of \var{fileobj} and return a \class{Dialect} class -reflecting the parameters found. +\begin{methoddesc}{sniff}{sample} +Analyze the sample text (presumed to be in CSV format) and return a +{}\class{Dialect} class reflecting the parameters found. \end{methoddesc} -\begin{methoddesc} - +\begin{methoddesc}{has_header}{sample} +Analyze the sample text (presumed to be in CSV format) and return +{}\code{True} if the first row appears to be a series of column headers. \end{methoddesc} \end{classdesc}
