Everything you could ever dream of
Project description
DSP Decision Engine
SpockFlow is a Python framework designed to create standalone micro-services that enrich data with actionable outputs. It supports both batch and live inference modes, and extends existing frameworks to simplify data flows, including policy rules and scoring. Leveraging Hamilton for traceability, SpockFlow provides a powerful, modular approach for data enrichment and model deployment.
Table of Contents
Introduction
SpockFlow is built to be extensible and modular, allowing the reuse of pipelines and configurations across multiple data flows. Its emphasis on runtime traceability and explainability is empowered by Hamilton, which helps track and visualize data lineage and identify process steps leading to specific outcomes.
For a more detailed introduction, see Introduction.
Installation
To get started with SpockFlow, you need to install the required dependencies. Follow the instructions in the Installation Guide to set up your environment.
pip install spockflow[all]
Concepts
Explore the foundational principles and components of SpockFlow in the Concepts section. This guide covers:
- Decision Trees: Automate decision-making processes based on defined conditions.
- Decision Tables: Map input values to outputs based on conditions.
- Score Cards: Assign scores to entities based on parameters.
- API Customization: Customize and extend SpockFlow functionalities.
Usage Examples
Here are some examples of how to use SpockFlow:
Decision Trees
Create and use decision trees in SpockFlow:
from spockflow.components.tree import Tree, Action
from spockflow.core import initialize_spock_module
import pandas as pd
from typing_extensions import TypedDict
class Reject(TypedDict):
code: int
description: str
RejectAction = Action[Reject]
# Initialize Tree
tree = Tree()
# Define conditions and actions
@tree.condition(output=RejectAction(code=102, description="My first condition"))
def first_condition(d: pd.Series, e: pd.Series, f: pd.Series) -> pd.Series:
return (d > 5) & (e > 5) & (f > 5)
tree.visualize(get_value_name=lambda x: x["description"][0])
For more details and advanced usage, check out the Concepts section.
Contributing
We welcome contributions to SpockFlow! Please refer to our Contributing Guide for information on how to contribute.
- Fork the repository and create a branch from
develop. - Install dependencies using
pip install -r requirements/all.txt. - Run tests with
pytestto ensure everything is working. - Submit a Pull Request with a clear description of your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for your interest in SpockFlow! We look forward to your contributions and feedback.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spockflow-0.3.0.post1.tar.gz.
File metadata
- Download URL: spockflow-0.3.0.post1.tar.gz
- Upload date:
- Size: 60.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
114a067f12ecf1af582705ce6713800de538ca60d6b54fb0b25c84a6f2a23596
|
|
| MD5 |
6fc692bd657600f3eb0c34f1d17a0b79
|
|
| BLAKE2b-256 |
fe7e2292ad17b55dbca8b50201836abeb35375d99563b4d4f10031a56e2554b9
|
Provenance
The following attestation bundles were made for spockflow-0.3.0.post1.tar.gz:
Publisher:
release.yml on capitec/dsp-decision-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spockflow-0.3.0.post1.tar.gz -
Subject digest:
114a067f12ecf1af582705ce6713800de538ca60d6b54fb0b25c84a6f2a23596 - Sigstore transparency entry: 244572743
- Sigstore integration time:
-
Permalink:
capitec/dsp-decision-engine@04f3198eee1120eefd87c6be629a05852bfaa7a5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/capitec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@04f3198eee1120eefd87c6be629a05852bfaa7a5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spockflow-0.3.0.post1-py3-none-any.whl.
File metadata
- Download URL: spockflow-0.3.0.post1-py3-none-any.whl
- Upload date:
- Size: 77.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f2a465c5a1304d39129d8f20fd3b332122bcdf640a77eb2dcd95785974969df
|
|
| MD5 |
2559a7239ada0118a5cc5eb41e6d10ff
|
|
| BLAKE2b-256 |
c14c350d2aac82dc6ad9b1321567e1df2ac8c9ccd5c13783cb43479f59149a67
|
Provenance
The following attestation bundles were made for spockflow-0.3.0.post1-py3-none-any.whl:
Publisher:
release.yml on capitec/dsp-decision-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spockflow-0.3.0.post1-py3-none-any.whl -
Subject digest:
3f2a465c5a1304d39129d8f20fd3b332122bcdf640a77eb2dcd95785974969df - Sigstore transparency entry: 244572744
- Sigstore integration time:
-
Permalink:
capitec/dsp-decision-engine@04f3198eee1120eefd87c6be629a05852bfaa7a5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/capitec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@04f3198eee1120eefd87c6be629a05852bfaa7a5 -
Trigger Event:
push
-
Statement type: