Rulebricks Spark
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rulebricks_spark-0.2.1.tar.gz | 217.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rulebricks_spark-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 265.6 kB
Release files / rulebricks_spark-0.2.1.tar.gz
| Download URL | rulebricks_spark-0.2.1.tar.gz |
|---|---|
| Size | 217.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf4a3c397fa853ca867e8c1606e1a97ecb53ceb1ed7c40d869457caca44a43ed
|
|
BLAKE2b-256 checksum How to use checksums |
0d66f87e86b4392445ab7c76168a8e59fdda180039e46a240d3fdbb560599639
|
| 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 17, 2026.
Transparency logRelease files / rulebricks_spark-0.2.1-py3-none-any.whl
| Download URL | rulebricks_spark-0.2.1-py3-none-any.whl |
|---|---|
| Size | 48.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c4b8d20971a9b2afc7f092efb5140019d11dfb8190555463bc386f30817edf4
|
|
BLAKE2b-256 checksum How to use checksums |
27e1d979d37809e7d5cb4a428566b1c52ac85d0a7fd8bdc39167cab05dbc86e1
|
| 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 17, 2026.
Transparency logSecurity for rulebricks-spark 0.2.1
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.
Attestation for rulebricks_spark-0.2.1.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 17, 2026.
Transparency logA 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.