Skip to main content

DSP Decision Engine

Python Version License

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.

Example Pipeline

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 pytest to 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.

Release files for SpockFlow 0.3.0.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SpockFlow 0.3.0.post2
File Size Uploaded
spockflow-0.3.0.post2.tar.gz 60.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SpockFlow 0.3.0.post2
File Interpreter ABI Platform
spockflow-0.3.0.post2-py3-none-any.whl Python 3 none any Details

Total release size: 137.2 kB

Release files / spockflow-0.3.0.post2.tar.gz

Download URL spockflow-0.3.0.post2.tar.gz
Size 60.1 kB
Tags Source
SHA-256 checksum
How to use checksums
08c154422257a0f6d1a1f747c3b6f56140f498a7bb252ae3ac53d51006003491
BLAKE2b-256 checksum
How to use checksums
3cc5dd83f641e233547d92ec291194c9ea39b415a10103e0fff46359c8d4dbc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

Release files / spockflow-0.3.0.post2-py3-none-any.whl

Download URL spockflow-0.3.0.post2-py3-none-any.whl
Size 77.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec20665036b3d1396f2960489369a79301c4008692b9d463b414d7ca5e3bd387
BLAKE2b-256 checksum
How to use checksums
9f9c0d830660c23127a6940adc974eb3cfe411ff7b28ad6b2539f163059916a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page