* separated values

Skip Montanaro skip at pobox.com
Tue Jan 15 16:45:11 EST 2002


    dave> I totally see how it'd be easier for you if it was in the std
    dave> library, but where do we stop? I for one have never needed a CSV
    dave> parser beyond simple comma-separated stuff so adding this to the
    dave> main distribution would never benefit me. I use PIL and Numeric
    dave> more, so shouldn't we include them instead (licensing issues
    dave> aside)? A CPAN solution is the only one that'll work.

CPAN is terrific when I know just what I need.  I type "install HTML::Mason"
and come back in a few minutes.  If all I knew was that I wanted a way to
generate HTML content dynamically, I'd have a much harder time of it.

Lots of people need to read and write CSV files (I've never used Numeric and
haven't used PIL in a few years, so there ;-).  The Python distribution has
a long history of supporting standard protocols well (NNTP, SMTP, etc.)  CSV
is really the same sort of thing.  It is the de facto standard interchange
format for the database and spreadsheet communities.  The protocol just
happens to be embedded in files.  It's challenging enough to parse that you
can't reliably use string.split (sometimes that will work, but often it
won't).  Choosing among any of a number of competing solutions, none of
which are head-and-shoulders better than the rest is, if not difficult, at
least annoying.  Having a CSV parser/generator in the core would solve this.
Dave Cole's csv module is less than 20k of C.  Cliff Wells' DSV.py is about
30k of Python.  Neither would be a strain on the core library, but would
provide support for a very useful file format.

Skip




More information about the Python-list mailing list