business-rules
Python DSL for setting up business intelligence rules that can be configured without code
What it is and what it does
business-rules is a rules engine that decouples business logic from code deployment. You define a set of variables (computed properties of your domain objects) and actions (side effects to trigger), then write rules as JSON objects specifying conditions over those variables and which actions to run. The engine evaluates the conditions and executes matching actions without requiring code changes or redeployment.
It's designed for scenarios where non-technical stakeholders (analysts, business users) need to configure system behavior—such as eligibility rules for discounts, automated workflows triggered by state changes, or marketing logic. The package exports metadata about available variables, operators, and actions so a UI can be built to let users compose rules visually. It depends only on six for Python 2/3 compatibility.
Use it for:
- Define marketing eligibility rules (e.g., discount thresholds) that analysts can adjust without code deployment
- Automate email triggers or notifications based on user state transitions or event sequences
- Configure inventory management rules (e.g., reorder when stock falls below threshold) dynamically
- Build a rule-based workflow system where business teams can add conditional logic without engineering involvement
- Export rule metadata to a web UI so non-developers can visually compose and test business rules
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python DSL for defining business rules as JSON that can be executed without redeploying code, letting non-developers configure system behavior through conditions and actions.
Yes, if you need a lightweight rules engine for non-developers to configure business logic without code changes. The package is stable (no known vulnerabilities, low install friction, permissive license) but dormant—last release was 2022-03-18. It works well for straightforward condition-action rules; evaluate whether its feature set and Python version support align with your project before committing to long-term use.
Install
business-rules on PyPI
pip
pip install business-rulesuv
uv add business-rulespoetry
poetry add business-rulesInstalling business-rules
Before you install
Low friction install with a single runtime dependency (six). Maintenance is dormant—last release was 2022-03-18—but the repository remains active with recent commits and 991 stars, suggesting the package is stable rather than abandoned.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install business-rules
from business_rules import run_all
from business_rules.variables import BaseVariables, numeric_rule_variable
from business_rules.actions import BaseActions, rule_action
class MyVariables(BaseVariables):
@numeric_rule_variable
def my_value(self):
return self.value
class MyActions(BaseActions):
@rule_action(params={})
def my_action(self):
pass
rules = [{"conditions": {"all": [{"name": "my_value", "operator": "greater_than", "value": 5}]}, "actions": [{"name": "my_action", "params": {}}]}]
run_all(rule_list=rules, defined_variables=MyVariables(), defined_actions=MyActions())
Verify before relying
- Whether the package works reliably with Python versions beyond 3.7 despite requires_python allowing current versions
- Performance characteristics when evaluating large rule sets or complex nested conditions
- Whether the package is actively maintained or in long-term stable maintenance mode given dormant status since 2022-03-18
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | dormant — 1,610 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 179,966/month — #10,157 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: business_rules-1.1.1-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
json-logicParses and executes JsonLogic rules—a…
permissive · top 5,000 on PyPI
json_logic_qubitParses and executes JsonLogic rules—a…
permissive · top 15,000 on PyPI
panzi-json-logicEvaluates JsonLogic and CertLogic…
permissive · top 15,000 on PyPI
zen-enginezen-engine is a Python binding for a Rust-based…
unclear · top 15,000 on PyPI
rulesrules provides object-level permission checking…
permissive · top 15,000 on PyPI
django-service-objectsProvides a Service base class for Django that…
permissive · top 15,000 on PyPI
boolean.pyParse, simplify, and compare boolean…
permissive · top 1,000 on PyPI
smdebug-rulesconfigProvides preconfigured rule definitions and…
permissive · top 5,000 on PyPI
trytondTrytond is the server component of Tryton, an…
copyleft · top 15,000 on PyPI
business-durationCalculates business duration between two dates…
permissive · top 15,000 on PyPI