[CSV] Re: First Cut at CSV PEP

Andrew McNamara andrewm at object-craft.com.au
Wed Jan 29 02:36:01 CET 2003


>Here we go again with a potentially bad idea...

*-)

>I think that there are two things we need to have for each dialect; a
>set of low level parser configuration, and a set of user tweakables
>(which correspond to options presented by the application).  The set
>of user tweakables may not necessarily map one-to-one with low level
>parser configuration items.

This seems to add a fair bit of complexity to the implementation, without
simplifying the interface much. In particular, it makes it difficult
for the user to move to an alternate dialect (because they'll need to
change all the config options). It also makes it harder for third parties
to implement their own dialects (or maintain the base ones). And it makes
the documenation and tests harder. KISS.

>Any sniffer would have to be able to traverse the set of dialects
>implemented in the CSV module and look inside them to understand
>which options are available to a dialect.

It might be enough to look at the first N lines of the file, and do some
basic stats (tabs per line, commas per line, etc). Whether it guesses a
dialect, or just tries to set individual options is another question.

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/



More information about the Csv mailing list