skillfed

business-rules

Python DSL for setting up business intelligence rules that can be configured without code

business-rules v1.1.1 180.0K downloads/30d#10,157 on PyPI991
Permissive license MIT DORMANT released

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-rules

uv

uv add business-rules

poetry

poetry add business-rules

Installing 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

Programming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7

Tags

business rules engine pythonrule-based decision logicdynamic business logic without codecondition-action rule systemconfigurable workflow rulesrule engine DSLbusiness intelligence rules
rule-enginebusiness-logicno-code-config

More Software Development packages