[Csv] confused about wrapping readers and writers

Cliff Wells LogiplexSoftware at earthlink.net
Mon Feb 10 19:19:19 CET 2003

On Mon, 2003-02-10 at 06:38, Skip Montanaro wrote:
>     >> The only possible addition now would be some kind of mechanism
>     >> whereby something like the db_row could be linked in with the module.
>     >> 
>     >> http://opensource.theopalgroup.com/
>     >> 
>     >> Mind you the application might be the best place to do this kind of
>     >> linkage.
>     Andrew> Maybe Skip's dictionary stuff would get us closer?
> Maybe, but there are enough object-relational mappers out there (I gather
> that's sort of what db_row is) that we can't possibly make everyone happy.
> I say we punt.  I haven't cvs up'd yet this morning.  Hopefully my
> DictReader and DictWriter classes still work. ;-)
>     Andrew> We haven't made any impression on the csv.utils sub-module yet -
>     Andrew> things like the sniffer. We want to watch we don't miss the 2.3
>     Andrew> boat - what's the next step?
> That's Cliff's expertise, and judging from his recent silence, I suspect
> he's still pretty busy with other things.  Cliff, assuming the rest of the
> code is pretty much set how are you fixed for time to work on a sniffer?
> Should we propose that's what's there now be incorporated into 2.3 and then
> aim for a separate csv.utils module between 2.3 and 2.4 (to be added in
> 2.4)?

Hi all,

Sorry about my MIA status.  I've gotten things at work reduced to
smoldering ashes, which is the usual state-of-affairs, so hopefully I
can actually contribute a bit.

I think we need to once again decide what we want/need in cvsutils. 
Obvious candidates are:

1. Sniffer for guessing delimiter
2. Sniffer for guessing quotechar
3. Sniffer for guessing whether first row is header

These were easy as they already exist in DSV ;)   We just need to decide
what the API will look like for the algorithms.  Right now the DSV stuff
just returns char, char, bool, respectively for the above functions.  It
would be easy to write a wrapper that calls all three consecutively and
returns a dialect object (I don't think it's necessary to match against
existing dialects, but maybe we should?).

4. Row -> dict converter.  This should be easy as well.  The user can
use the results of the guessHeaders() sniffer or just provide their own
list of names to use as keys.  I haven't looked at Skip's code yet, but
I don't see how this can be anything but trivial.

What other things are we looking at? 

Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308

More information about the Csv mailing list