Skip to content

Instantly share code, notes, and snippets.

@wkerzendorf
Last active July 9, 2017 16:51
Show Gist options
  • Save wkerzendorf/395c85a2955002412be302d708329f7f to your computer and use it in GitHub Desktop.
Save wkerzendorf/395c85a2955002412be302d708329f7f to your computer and use it in GitHub Desktop.
import luigi
from glob import glob
import os
raw_zips = '/1002/*.gz'
class ExtractGZ(luigi.Task):
document_id = luigi.Parameter()
def output(self):
return luigi.LocalTarget(self.document_id + '.txt')
def run(self):
print os.path.dirname(self.document_id)
class TestTask(luigi.WrapperTask):
def requires(self):
for fname in glob(raw_zips):
#print fname
yield ExtractGZ(fname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment