PEP 305 - CSV File API

Roman Suzi rnd at onego.ru
Sun Feb 2 05:54:57 EST 2003


On 2 Feb 2003, Dave Cole wrote:

>>>>>> "Roman" == Roman Suzi <rnd at onego.ru> writes:
>
>Roman> On Fri, 31 Jan 2003, Skip Montanaro wrote:
>>> * What about conversion to other file formats? Is the list-of-lists
>>>   output from the csvreader sufficient to feed into other writers?
>
>Roman> It could also be interesting to be able to use attribute access
>Roman> to fields:
>
>Roman> for row in cvsreader:
>Roman>     ... row.field1 ...
>Roman>     ... row.field2 ...
>
>Roman> and dictionary is sometimes needed, like in this example:
>
>Roman> for row in cvsreader:
>Roman>     print "%(field1)s - %(field2)s" % row.field1
>
>Roman> But these examples assume I need to provide names to fields.
>
>We have planned to include a higher level module called csvutils.py
>which would be the logical place to have things like this.

I do not think named fields are really higher level. It could be done
by subclassing cvsreader/writer with proper additions.

Sincerely yours, Roman Suzi
-- 
rnd at onego.ru =\= My AI powered by Linux RedHat 7.3






More information about the Python-list mailing list