Skip to content

import_from_csv doesn't respect CSV default fmtparams overwriting #208

Description

@berinhard

Currently, I'm using rows to import a CSV file like this:

LAST NAME, FIRST NAME;LANGUAGE;Address 1;Address 2;RATE;Mobile;Home;Fax;email
Fontes, Bernardo;Portuguese, English;0, Rua dos Bobos;São Paulo, RJ 0101010;$10;1234-4321;1234-4321;1234-4321;berin@example.com

But is acceptable to accept an entry only with the name and email values like the following:

LAST NAME, FIRST NAME;LANGUAGE;Address 1;Address 2;RATE;Mobile;Home;Fax;email
Fontes, Bernardo, Ali;;;;;;;;berin@example.com

When trying to import this CSV, the lib gets confused and stops use the ; as delimiter and starts to use ,. So, it would be nice to have a way to overwrite the delimiter parameter to be passed to csv.reader here.

I know that I can do that by passing a custom Dialect object within the dialect parameter, but, in my opinion, this is less straightforward than following Python API.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions