manage a workflow written in csv
Project description
Workflow module
Description
The Workflow module manages a sequence, ie a list of steps which are linked together in a sequential way.
To define such a sequence, create a table in excel or csv file with columns named:
- stepId
- title
- nexts
stepId is the unique step identifier,
title is an arbitrary name of the step,
nexts is a list of stepIds that follows the step. The list is given by stepIds separated with '-' .
Here is an example:
stepId | title | nexts |
---|---|---|
1 | my first step | 2-3 |
2 | my second step | 4 |
3 | step 3! | 12 |
4 | step4 | |
9 | step9 | 12-4 |
12 | step12 |
In this example, steps 1 and 9 are the first steps in the workflow because the don't have any previous step.
Steps 4 and 12 are the last steps because they don't have any next step.
- Step 1 points to 2 next steps: steps 2 and 3,
- Step 2 points to step 4, ...
As we can see, there is no need to define a continuous suite fo stepIds and the identifiers don't need to be sorted.
Basic call example
import pandas as pd
from pycroaktools.workflow.workflow import Workflow
workflow = Workflow(pd.read_csv('workflow.csv'), 'myWorkflow') #read_csv may be replaced by read_excel
paths = workflow.getAllPaths()
for path in paths:
for step in path:
print(step.stepId)
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
Built Distribution
Hashes for pySimpleWorkflow-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a3bb32b218473784ecb22487f2ab3b48dd0f71f0c12ec6f3a6f2720d07eeae0 |
|
MD5 | f4e9b3b1c5f13ff0f6dab709ccdd0bbb |
|
BLAKE2b-256 | 1b3e0f448f897a53e4b9ea81dafa0fd35fa848136cf78bc0086cb5ce33607871 |