Skip to main content

Rulebricks Spark

Rulebricks Spark

PyPI

Apply versioned Rulebricks rules and flows to PySpark DataFrames. The library sends records in bounded requests and keeps each decision, error, and execution ID alongside its source data, so the pipeline can scale without losing the ability to explain a run.

pip install rulebricks-spark
import os

from rulebricks_spark import apply_flow

results = apply_flow(
    source,
    "order-routing-flow",
    version="1",
    api_key=os.environ["RULEBRICKS_API_KEY"],
    base_url="https://rulebricks.acme.com/api/v1",
    correlation_id_path="request_id",
    execution_partitions=4,
)
results.write.format("delta").mode("errorifexists").save(result_path)
saved = spark.read.format("delta").load(result_path)

Flow results remain JSON by default, ready for your own Spark expressions. apply_rule() uses the same execution model and infers a typed result from the selected rule version. Context operations provide optional input staging and ordered stateful processing, while Structured Streaming uses Spark's ordinary foreachBatch interface.

Start with the documentation or the notebook walkthroughs. The guides explain how the concepts fit together; the reference covers parameters, result fields, failure handling, and recovery. Notebook settings are defined in the notebooks, with only credentials kept in a secret manager or environment.

The package targets classic PySpark 3.5 and requires Python 3.9+ and PyArrow 18+. Use a Python version supported by your Spark runtime. For a documentation preview, follow the Sphinx build instructions.

Metadata

Release files for rulebricks-spark 0.2.0

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

Source distribution (sdist)

Source distribution for rulebricks-spark 0.2.0
File Size Uploaded Provenance
rulebricks_spark-0.2.0.tar.gz 216.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rulebricks-spark 0.2.0
File Interpreter ABI Platform
rulebricks_spark-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 264.4 kB

Release files / rulebricks_spark-0.2.0.tar.gz

Download URL rulebricks_spark-0.2.0.tar.gz
Size 216.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7761fd61850e42f01bb311668353ee50808dc9acbddfd23af969fb6b6371b0a9
BLAKE2b-256 checksum
How to use checksums
8e67d224437e904d8ccbcc271e1443d4ada448a0d9d4378b9354b03b124167f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release files / rulebricks_spark-0.2.0-py3-none-any.whl

Download URL rulebricks_spark-0.2.0-py3-none-any.whl
Size 48.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2643b1215a7b849d91780e8ad1e1c4047961f2c867c30e44955a0a9266985fc
BLAKE2b-256 checksum
How to use checksums
b442709c8e338a69a02d07daf16c5428a9eb90a47387ec87573ef76a80c5cd4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Security for rulebricks-spark 0.2.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rulebricks_spark-0.2.0.tar.gz

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 Sep 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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