[CSV] Re: First Cut at CSV PEP
Andrew McNamara
andrewm at object-craft.com.au
Wed Jan 29 01:08:16 CET 2003
>I think it is important to keep in mind the users of the module who
>are not expert in the various dialects of CSV. If presented with a
>flat list of all options supported they are going to engage in a fair
>amount of head scratching.
>
>If we try to make things easier for users by mirroring the options
>that their application presents then they are going to have a much
>easier time working out how to use the module for their specific
>problem. By limiting the available options based upon the dialect
>specified by the user we will be doing them a favour.
>
>The point of the 'raw' dialect is to expose the full capabilities of
>the raw parser. Maybe we should use None rather than 'raw'.
My feeling is that this simply changes the shape of the complexity
without really helping.
I think we should just stick with the "a dialect is a set of defaults"
idea.
>Hmm... What would be the best way to handle Excel TSV. Maybe a new
>dialect 'excel-tsv'?
When saving, Excel97 calls this "Text (Tab delimited)", so maybe
"excel-tab" would be clear enough. CSV is "CSV (Comma delimited)".
On import, it seems to just guess what the file is - I couldn't see a way
under Excel97 to specify.
>I am not saying that the wrapper should absolutely prevent someone
>from using options not available in the application. If you want to
>break the dialect then maybe it should be a two step process.
>
> csvwriter = csv.writer(file("newnastiness.csv", "w"),
> dialect='excel2000')
> csvwriter.setparams(delimiter='"')
This strikes me as B&D.
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
More information about the Csv
mailing list