aboutcode.pipeline 0.1.0

Creator: codyrutscher

Last updated:

Add to Cart

Description:

aboutcode.pipeline 0.1.0

aboutcode.pipeline
Define and run pipelines.
Install
pip install aboutcode.pipeline

Define and execute a pipeline
from aboutcode.pipeline import BasePipeline

class PrintMessages(BasePipeline):
@classmethod
def steps(cls):
return (cls.step1,)

def step1(self):
print("Message from step1")

PrintMessages().execute()

Groups and steps selection
from aboutcode.pipeline import BasePipeline
from aboutcode.pipeline import group

class PrintMessages(BasePipeline):
@classmethod
def steps(cls):
return (cls.step1, cls.step2)

def step1(self):
print("Message from step1")

@group("foo")
def step2(self):
print("Message from step2")


# Execute pipeline with group selection
run = PrintMessages(selected_groups=["foo"])
exitcode, error = run.execute()

# Execute pipeline with steps selection
run = PrintMessages(selected_steps=["step1"])
exitcode, error = run.execute()

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.