Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG+1] Allow to specify the quotechar in CSVFeedSpider #882

Merged
merged 2 commits into from Nov 4, 2014

Conversation

@ahlen
Copy link
Contributor

@ahlen ahlen commented Sep 13, 2014

Hi,

this PR make it possible to pass a quotechar to the csviter (and csv.reader) and specify which enclosing/quoting character to use in the CSVFeedSpider. Today it is only possible to set a custom delimiter [1] but no other parameters to the csv.reader and a question may also be if it is enough with quotechar or if the csviter should expose more, like dialects [2] to be even more generic.

This solves a scenario when a CSV file use any other quoting character than the default (", quotation mark), such as the single quote '. Without this the keys and values will be enclosed by the single quote, e.g. u"'key'".

[1] http://doc.scrapy.org/en/latest/topics/spiders.html#csvfeedspider
[2] https://docs.python.org/2/library/csv.html#csv.reader

@kmike
Copy link
Member

@kmike kmike commented Sep 22, 2014

LGTM, +1 to merge.

@kmike kmike changed the title Allow to specify the quotechar in CSVFeedSpider [MRG+1] Allow to specify the quotechar in CSVFeedSpider Sep 24, 2014
pablohoffman added a commit that referenced this pull request Nov 4, 2014
[MRG+1] Allow to specify the quotechar in CSVFeedSpider
@pablohoffman pablohoffman merged commit efe589c into scrapy:master Nov 4, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@ahlen ahlen deleted the ahlen:feature/csvfeed-quotechar branch Nov 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.