Skip to content

Instantly share code, notes, and snippets.

@ericbusboom
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericbusboom/8f7b6f3373b7eb833d9c to your computer and use it in GitHub Desktop.
Save ericbusboom/8f7b6f3373b7eb833d9c to your computer and use it in GitHub Desktop.
row_gen_for_source
def row_gen_for_source(self, source_name, use_row_spec = True):
source = self.metadata.sources[source_name]
fn = self.filesystem.download(source_name)
if fn.endswith('.zip'):
sub_file = source.file
fn = self.filesystem.unzip(fn, regex=sub_file)
return DelimitedRowGenerator(fn, delimiter = '\t')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment