Skip to main content

Outflow is a framework that helps you build and run task workflows.

The api is as simple as possible while still giving the user full control over the definition and execution of the workflows.

Feature highlight :

  • Simple but powerful API
  • Support for parallelized and distributed execution
  • Centralized command line interface for your pipeline commands
  • Integrated database access, sqlalchemy models and alembic migrations
  • Executions and exceptions logging for tracability
  • Strict type and input/output checking for a robust pipeline

Check out our documentation for more information.

Installing

Install and update using pip:

pip install -U outflow

Quick start

One file starter

Create a pipeline.py script:

# -- pipeline.py
from outflow.core.commands import Command, RootCommand
from outflow.core.pipeline import Pipeline
from outflow.core.tasks import Task


# with the as_task decorator, the function will be automatically converted into a Task subclass
# the signature of the function, including the return type, is used to determine task inputs and outputs
@Task.as_task
def GetValues() -> {'a': str, 'b': str}:
    return {'a': 'hello', 'b': 'world'}

# default values can also be used as inputs
@Task.as_task
def PrintValues(a: str, b: str, c: str = '?' ):
    print(f"{a} {b}{c}")

@RootCommand.subcommand()
class HelloWorld(Command):

    def setup_tasks(self):
        # instantiate tasks
        get_values = GetValues()

        # you can specify inputs value during instantiation
        print_values = PrintValues(c="!")

        # build the workflow
        get_values >> print_values

        # return the terminating task(s) of the workflow
        # they will be used as entrypoints to navigate through the execution tree
        return [print_values]

if __name__ == "__main__":
    # instantiate and run the pipeline
    with Pipeline(
        root_directory=None,
        settings_module="outflow.core.pipeline.default_settings",
        force_dry_run=True,
    ) as pipeline:
        result =  pipeline.run()

and run your first Outflow pipeline:

$ python pipeline.py hello_world

A robust, configurable and well-organized pipeline

You had a brief overview of Outflow's features and you want to go further. Outflow offers command line tools to help you to start your pipeline project.

First, we will need to auto-generate the pipeline structure -- a collection of files including the pipeline settings, the database and the cluster configuration, etc.

$ python -m outflow management create pipeline my_pipeline

Then, we have to create a plugin -- a dedicated folder regrouping the commands, the tasks as well as the description of the database (the models)

$ python -m outflow management create plugin my_namespace.my_plugin --plugin_dir my_pipeline/plugins/my_plugin

In the my_pipeline/settings.py file, add your new plugin to the plugin list:

PLUGINS = [
    'outflow.management',
    'my_namespace.my_plugin',
]

and run the following command:

$ python ./my_pipeline/manage.py my_plugin

You'll see the following output on the command line:

 * outflow.core.pipeline.pipeline - pipeline.py:325 - INFO - No cluster config found in configuration file, running in a local cluster
 * my_namespace.my_plugin.commands - commands.py:49 - INFO - Hello from my_plugin

Your pipeline is up and running. You can now start adding new tasks and commands.

Contributing

For guidance on setting up a development environment and how to make a contribution to Outflow, see the contributing guidelines.

Metadata

Release files for outflow 0.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for outflow 0.5.5
File Size Uploaded
outflow-0.5.5.tar.gz 77.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for outflow 0.5.5
File Interpreter ABI Platform
outflow-0.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 186.9 kB

Release files / outflow-0.5.5.tar.gz

Download URL outflow-0.5.5.tar.gz
Size 77.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b82af810de93923a4daa907e3580c9280d90076a99cbb0c5eea9e84cc74b065e
BLAKE2b-256 checksum
How to use checksums
2c2d30345819f67efad3d2295b4898c68f2159fd5a01720f38ebbf5c411a00c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.8.12 Linux/5.14.9-arch2-1

Release files / outflow-0.5.5-py3-none-any.whl

Download URL outflow-0.5.5-py3-none-any.whl
Size 109.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d1ed1a2c075a5cf127aa8511f1ea59f3d9f3e807d00b89ec084f9273ece11e4
BLAKE2b-256 checksum
How to use checksums
623f938693cd92a6191778ed7bf289389bf136381da5bee273d3078028ebe73d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.8.12 Linux/5.14.9-arch2-1

Release history Release notifications | RSS feed

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.7

2 release files

This release

0.5.5 This release

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page