Skip to content

support custom delimiters and gzipped files#3

Open
drewbanin wants to merge 2 commits intomasterfrom
gzip-and-custom-delimiters
Open

support custom delimiters and gzipped files#3
drewbanin wants to merge 2 commits intomasterfrom
gzip-and-custom-delimiters

Conversation

@drewbanin
Copy link

@drewbanin drewbanin commented Apr 11, 2019

  • Adds a delimiter (string) field to control the csv delimiter
  • Adds an unzip (bool) field to optionally gunzip the file before reading it as a csv

(work in progress)

@drewbanin drewbanin requested a review from cmcarthur April 11, 2019 19:56
char = chr(byte)
if char == '\n':
yield buf.encode('utf-8')
buf = ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait.... why do we need to break this down into lines at all? it seems like you could just pass the result of gunzip to the csv.DictReader

Copy link
Member

@cmcarthur cmcarthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jk

@drewbanin drewbanin force-pushed the gzip-and-custom-delimiters branch from af165e4 to b5c13ff Compare April 11, 2019 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants