v2.0

GoRules Version 2 is here - redesigned, now with managed cloud.GoRules Version 2 is here!

Watch the launch videoWatch
Python SDK

Python
rules engine.

Open source Python rules engine powered by Rust. Evaluate decision tables and business rules with sub-millisecond latency. pip install zen-engine.

Up and running
in three steps.

Install the SDK, load a decision graph, evaluate - the same JSON your team edits in the visual editor runs in your process.

Step 1

Install the SDK

Install the GoRules engine using pip.

pip install zen-engine
Step 2

Load a Decision

Create an engine and load your decision graph from a JSON file.

import zen

with open("./decision.json", "r") as f:
    content = f.read()

engine = zen.ZenEngine()
decision = engine.create_decision(content)
Step 3

Evaluate Rules

Pass your input data and receive the decision result.

result = decision.evaluate({
    "customer": {"tier": "premium", "country": "US"},
    "cart": {"total": 150, "items": 3}
})

print(result["result"])  # {"discount": 15, "freeShipping": True}

Why
Python?

Built for performance and developer experience - native speed with an API that feels at home in your codebase.

Rust-Powered Performance

Native bindings to our Rust engine deliver near-native speed. No Python GIL limitations for rule evaluation.

Simple API

Pythonic interface that feels natural. Load a decision graph and start evaluating in just a few lines.

Type Hints Included

Full type hint support for better IDE integration and code completion.

About the Python SDK

GoRules brings enterprise-grade business rules management to Python applications. The SDK provides native bindings to our Rust-based engine, delivering performance that pure Python implementations simply cannot match.

Perfect for data pipelines, ML feature engineering, and backend services, the Python SDK integrates seamlessly with your existing codebase. Load decision graphs created in the visual editor and evaluate them with a simple, Pythonic API.

The engine handles complex decision logic including decision tables, expression evaluation, and branching rule graphs. All processing happens in-process with no external service calls, making it ideal for batch processing, real-time APIs, and anywhere low latency matters.

See the public Zen Engine benchmarks

Build with Python.
Govern with GoRules.

The engine is open source and free forever - add the GoRules BRMS when your team needs versioning, approvals, and an audit trail.