Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5d0136e2
Commit
5d0136e2
authored
Apr 25, 2003
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reflect csv's change back to a module. Document the new sniffer api.
parent
9f48045e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
Doc/lib/libcsv.tex
Doc/lib/libcsv.tex
+14
-20
No files found.
Doc/lib/libcsv.tex
View file @
5d0136e2
...
...
@@ -19,18 +19,18 @@ vary, the overall format is similar enough that it is possible to write a
single module which can efficiently manipulate such data, hiding the details
of reading and writing the data from the programmer.
The
\module
{
csv
}
packag
e implements classes to read and write tabular data in
The
\module
{
csv
}
modul
e 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
}
packag
e's
\class
{
reader
}
and
\class
{
writer
}
objects read and
The
\module
{
csv
}
modul
e'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
}
packag
e doesn't support Unicode
\note
{
The first version of the
\module
{
csv
}
modul
e 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 @@ to be safe. These restrictions will be removed in the future.}
\end{seealso}
\subsection
{
Packag
e Contents
}
\subsection
{
Modul
e Contents
}
The
\module
{
csv
}
packag
e defines the following functions:
The
\module
{
csv
}
modul
e defines the following functions:
\begin{funcdesc}
{
reader
}{
csvfile
\optional
{
,
dialect=
\code
{
'excel'
}
\optional
{
, fmtparam
}}}
...
...
@@ -109,7 +109,7 @@ Return the names of all registered dialects.
\end{funcdesc}
The
\module
{
csv
}
packag
e defines the following classes:
The
\module
{
csv
}
modul
e defines the following classes:
\begin{classdesc}
{
DictReader
}{
csvfile, fieldnames
\optional
{
,
restkey=
\code
{
None
}
\optional
{
,
...
...
@@ -263,24 +263,18 @@ according to the current dialect.
\end{methoddesc}
\
subsection
{
Submodule
\code
{
utils
}
}
\
begin{classdesc}
{
Sniffer
}{
}
The
\module
{
csv
}
package contains a
\module
{
utils
}
submodule which defines
the following class.
The
\class
{
Sniffer
}
class is used to deduce the format of a CSV file.
\begin{classdesc}
{
Sniffer
}{
\optional
{
sample=16384
}}
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}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment