Pipeline development framework, easy to experiment and compare different pipelines, quick to deploy to workflow orchestration tools
Most of the current workflow orchestrators focus on executing the already-developed pipelines in production. This library focuses on the pipeline development process. It aims to make it easy to develop pipeline, and once the user reaches a good pipeline, it aims to make it easy to export to other production-grade workflow orchestrators. Notable features:
- Manage pipeline experiment: store pipeline run outputs, compare pipelines & visualize.
- Support pipeline as code: allow complex customization.
- Support pipeline as configuration - suitable for plug-and-play when pipeline is more stable.
- Fast pipeline execution, auto-cache & run from cache when necessary.
- Allow version control of artifacts with git-lfs/dvc/god...
- Export pipeline to compatible workflow orchestration tools (e.g. Argo workflow, Airflow, Kubeflow...).
Install
pip install theflow
Quick start
(A code walk-through of this session is stored in examples/10-minutes-quick-start.ipynb. You can run it with Google Colab (TODO - attach the link).)
Pipeline can be defined as code. You initialize all the ops in self.initialize and route them in self.run.
from theflow import Function
# Define some operations used inside the pipeline
# Operation 1: normal class-based Python object
class IncrementBy(Function):
x: int
def run(self, y):
return self.x + y
# Operation 2: normal Python function
def decrement_by_5(x):
return x - 5
# Declare flow
class MathFlow(Function):
increment: Function
decrement: Function
def run(self, x):
# Route the operations in the flow
y = self.increment(x)
y = self.decrement(y)
y = self.increment(y)
return y
flow = MathFlow(increment=IncrementBy(x=10), decrement=decrement_by_5)
You run the pipeline by directly calling it. The output is the same object returned by self.run.
output = flow(x=5)
print(f"{output=}, {type(output)=}") # output=5, type(output)=int
You can investigate pipeline's last run through the last_run property.
flow.last_run.id() # id of the last run
flow.last_run.logs() # list all information of each step
# [TODO] flow.last_run.visualize(path="vis.png") # export the graph in `vis.png` file
Future features
- Arguments management
- Cache
- cache by runs, organized by root task, allow reproducible
- specify the files
- the keys are like
lru_cache, takes in the original input key, specify the cache, but the cache should be file-backed, for run-after-run execution. - cli command to manipulate cache
- Compare pipeline in a result folder
- Dynamically create reproducible config
- Support pipeline branching and merging
- Support single process or multi-processing pipeline running
- Can synchronize changes in the workflow, allowing logs from different run to be compatible with each other
- Compare different runs
- Same cache directory
- Compare evaluation result based on kwargs
- CLI List runs
- CLI Delete unnecessary runs
- Add coverage, pre-commit, CI...
License
MIT License.
Metadata
Release files for theflow 0.8.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| theflow-0.8.6.tar.gz | 52.2 kB | Without provenance | Details for theflow-0.8.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| theflow-0.8.6-py3-none-any.whl | Python 3 | none | any | Details for theflow-0.8.6-py3-none-any.whl |
Total release size: 100.4 kB
Release files / theflow-0.8.6.tar.gz
| Download URL | theflow-0.8.6.tar.gz |
|---|---|
| Size | 52.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b0b830e9c5691f2a697aa8ff53927e9c965c2422c5001bef6de9a13ef7f577c
|
|
BLAKE2b-256 checksum How to use checksums |
9a34e5e4c44d1514885fc161606941e7e92f59f81842c82bc366b32121c6b3b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / theflow-0.8.6-py3-none-any.whl
| Download URL | theflow-0.8.6-py3-none-any.whl |
|---|---|
| Size | 48.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b430c6ea0d2617b0cb5087df7b7922d7592619e7b7ffe8dbd164db6f219e8951
|
|
BLAKE2b-256 checksum How to use checksums |
a1aee7e2f20bedfce559ce52f5f82b180f58c58431576768a7d29621f18ee504
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for theflow 0.8.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.