DSVWizard.py

Skip Montanaro skip at pobox.com
Mon Jan 27 01:33:11 CET 2003


I'm adding Dave Cole to the distribution list on this note.  Dave, Kevin
Altis, Cliff Wells (author of DSV) and I have exchanged a few messages about
trying to develop a CSV API for Python.

    >> I suspect most of the differences I see between the DSV and csv
    >> modules are due to interpretation differences between Cliff and Dave.

    Cliff> Or a bug in an older version of DSV.  If you have anything that
    Cliff> differs using 1.4, please pass it on so I can take a look at it.

I downloaded 1.4 just now.  The sfsample.csv file is now processed
identically by the two modules.  The nastiness.csv file generates three
differences though:

    % python shootout.py nastiness.csv 
    DSV: 0.01 seconds, 13 rows
    csv: 0.00 seconds, 13 rows
    2
    DSV: ['Test 1', 'Fred said "hey!", and left the room', '']
    csv: ['Test 1', ' "Fred said ""hey!""', ' and left the room"', ' ""']
    10
    DSV: ['Test 9', 'no spaces around this', ' but single spaces around this ']
    csv: ['Test 9', ' "no spaces around this" ', ' but single spaces around this ']
    12
    DSV: ['Test 11', 'has no spaces around anything', 'because the data is quoted']
    csv: ['   "Test 11"  ', '   "has no spaces around anything"   ', '   "because the data is quoted"    ']

All the three lines have white space immediately following separating
commas.  DSV appears to skip over this white space, while csv treats it as
part of the field contents.

Skip

PS, Just so Dave has the same "test harness", I've attached shootout.py and
nastiness.csv.  The shootout.py script now assumes DSV is installed with the
package structure of DSV 1.4.0.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: shootout.py
Type: application/octet-stream
Size: 730 bytes
Desc: not available
Url : http://mail.python.org/pipermail/csv/attachments/20030126/a4de7492/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nastiness.csv
Type: application/octet-stream
Size: 600 bytes
Desc: not available
Url : http://mail.python.org/pipermail/csv/attachments/20030126/a4de7492/attachment-0001.obj 


More information about the Csv mailing list