A lightweight pipeline framework
Project description
PipeLayer
PipeLayer is a event-driven pipeline framework. Define a series of steps, and chain them together to create modular applications.
Table of Contents
- Installation
- Getting Started
- The Framework
Complete documentation can be found here: greaterthan.solutions/pipelayer
Installation
From the command line:
pip install pipelayer
Getting Started
Step 1: Create The Filters
hello_world_filters.py
from pipelayer import Filter
class HelloFilter(Filter):
def run(self, data, context):
return "Hello"
class WorldFilter(Filter):
def run(self, data, context):
return f"{data}, World!"
functions.py
def create_message(data, context):
return {"message": data}
Step 2: Create The Pipeline
Create a module to run the pipeline:
app.py
import json
from pipelayer import Pipeline
from pipelayer.util import render_manifest
from functions import create_message
from hello_world_filters import HelloFilter, WorldFilter
if __name__ == "__main__":
hello_world_pipeline = Pipeline(
[
HelloFilter,
WorldFilter,
create_message,
lambda data, context: json.dumps(data),
]
)
output = hello_world_pipeline.run(None)
# output = '{"message": "Hello, World!"}'
print("\nPipeline Output:")
print(output)
print("\nManifest:")
print(render_manifest(hello_world_pipeline.manifest))
Step 3: Run the Pipeline
from the command line:
run app.py
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
pipelayer-0.6.0.tar.gz
(10.2 kB
view hashes)
Built Distribution
pipelayer-0.6.0-py3-none-any.whl
(11.7 kB
view hashes)
Close
Hashes for pipelayer-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6191fbf47150d875939ca8b8cf94b542c14ed25afb64138595bd36d5eb9c10ea |
|
MD5 | 1741502a6ed7f5bfd054ced4c2a88940 |
|
BLAKE2b-256 | f8b1e82c738ee324b5658a3a4b51f5b4f7ddfd71ab614bd4ad869c8b93c3517e |