[Csv] Re: Request for enhancement for csv

paul brian paul1brian at gmail.com
Fri Sep 30 10:56:08 CEST 2005


My apologies for the last post - I could only find bug reports on
sourceforge until 2 minutes after posting to you.

Again my apologies



On 9/30/05, paul brian <paul1brian at gmail.com> wrote:
> Dear csv maintainer,
>
> I am uncertain if this is the correct place for a RFE, please point me
> to an appropriate place if not.  I felt it would be safer to annoy one
> person rather than an entire python-dev mailing list.
>
> Apologies if I have succeeded in annoying you of course :-)
>
> I have not had a look at the csv repository but if you could confirm
> this is not a terrible idea or already done please also give me any
> pointers you might think of - its an itch and I think I shall have to
> scratch it in the next week or two.
>
> thank you
>
>
> Test for correct header row
> ====================
>
> When opening a csv file using DictReader, I would like to be able to
> test that the file contains the correct header files as I expected.
> This would prevent me from opening the incorrect file and seeing a
> indexError.
>
> I suspect the best approach would be to add a *strict* option to the
> constructor's parameters as follows
>
> class DictReader( csvfile[, fieldnames=None[,Strict,[, restkey=None[,
> restval=None[, dialect='excel' [, *args, **kwds]]]]]])
>
> if strict exists and is True then fieldnames must also exist and the
> csv module would inspect the first line and raise a "headerViolation"
> error if fielnames does not match the first row when first row is
> converted to a list.
>
>
>
> --
> --------------------------
> Paul Brian
> m. 07875 074 534
> t. 0208 352 1741
>


--
--------------------------
Paul Brian
m. 07875 074 534
t. 0208 352 1741



More information about the Csv mailing list