Skip to content

Instantly share code, notes, and snippets.

@samuell
Last active December 27, 2015 18:39
Show Gist options
  • Select an option

  • Save samuell/7371400 to your computer and use it in GitHub Desktop.

Select an option

Save samuell/7371400 to your computer and use it in GitHub Desktop.
class ATask(luigi.Task):
def requires(self):
# Defines what is the upstream task to this one.
# Is later used by the input() function.
return APreviousTask()
def output(self):
return luigi.LocalTarget(self.input().path + ".new_extension")
def run(self):
# Loop over the input file, and just write each line to the output file.
with self.input().open() as infile, self.output().open() as outfile:
for line in infile:
outfile.writeline(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment