Skip to main content

Everything you could ever dream of

Project description

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.

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

spockflow-0.3.0rc84.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

SpockFlow-0.3.0rc84-py3-none-any.whl (69.1 kB view details)

Uploaded Python 3

File details

Details for the file spockflow-0.3.0rc84.tar.gz.

File metadata

  • Download URL: spockflow-0.3.0rc84.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for spockflow-0.3.0rc84.tar.gz
Algorithm Hash digest
SHA256 87b99cf444efc5fd94e645079310fbccf83a9a2e73bfc6ab952c1bd09aabe489
MD5 ad9619614f2c51380a2a16f88d33d007
BLAKE2b-256 0afa19e93ec221b699b1ced722d6f9c42395bab60e76b054e0d13965a990bfb1

See more details on using hashes here.

File details

Details for the file SpockFlow-0.3.0rc84-py3-none-any.whl.

File metadata

File hashes

Hashes for SpockFlow-0.3.0rc84-py3-none-any.whl
Algorithm Hash digest
SHA256 bf58cded6412c3c86f1fb9e1491de2e9286234c21bbc5bfa07ac474455cfa7a3
MD5 fbc11599fbd9ec241a8ffe58d163f371
BLAKE2b-256 d0cc6137cb7d3bff6f8a7abe5431608900dc69c5ac6fc74700392c9b7b7bd76e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page