Class for manipulating a pipeline of functions, creating chains of functions processing the same context
Project description
PIPELINE-FUNCTIONS
Class for manipulating a pipeline of functions, creating chains of functions processing the same context. In this way it is possible that functions can send information between them through the execution chain.
Example of how it works
-> Function one receives a parameter, executes and returns data.
-> Function two receives as a parameter the result of the previous one, executes and returns data.
...
-> Final function takes data from all previous functions and processes.
Install
$ pip install pipeline-functions
Example
from pipeline_functions import PipelineFunctions
def hello(parameter: dict = {}):
print("Calling hello...")
parameter.update({ "hello": "Hello!" })
return parameter
def middle(parameter: dict = {}):
print("Calling middle...")
raise Exception()
return parameter
def world(parameter: dict = {}):
print("Calling world...")
parameter.update({ "world": "World!" })
return parameter
def finish(parameter: dict = {}):
print("Calling finish...")
print(parameter)
return parameter
if __name__ == "__main__":
pipeline = PipelineFunctions(
functions=[hello, middle, world, finish],
debug_mode=True,
block_mode=False
)
pipeline.execute(param = {"universe": "universe!"})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pipeline_functions-0.0.1.tar.gz
(15.7 kB
view details)
Built Distribution
File details
Details for the file pipeline_functions-0.0.1.tar.gz
.
File metadata
- Download URL: pipeline_functions-0.0.1.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f39fbdcadbf8f21a8361dc960b941733cece07dab9df69bd774babb0a718734 |
|
MD5 | edac4aa142dee15df8bdd57448ec2532 |
|
BLAKE2b-256 | 5c21628a96d0a5f19a959ba6355b79855713a03309bef3936745a3340cefedf9 |
File details
Details for the file pipeline_functions-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pipeline_functions-0.0.1-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 456d8899f29ab155a8ddea9a20f760b8b340a948bc97fa5084ebec40749f91cf |
|
MD5 | 743fb02287189f84982f9ea8977f2542 |
|
BLAKE2b-256 | c7d9168f21914248804b15604bcb6b7c3ddd37c8b36bee4610e8b76cb0a69ce7 |