Skip to main content

AboutCode Pipeline library. Execute code in steps.

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aboutcode_pipeline-0.1.0.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

aboutcode_pipeline-0.1.0-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page