Install the SDK
Install the GoRules engine using pip.
pip install zen-engineLoad 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)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
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.