python-rule-engine
A rule engine where rules are defined in JSON format. The syntax of the rules belongs to the json-rules-engine javascript library though it contains some changes to make it more powerfull.
Installation
pip install python-rule-engine
Quick Example
from python_rule_engine import RuleEngine
rule = {
"name": "basic_rule",
"conditions": {
"all": [
{
# JSONPath support
"path": "$.person.name",
"operator": "equal",
"value": "Lionel"
},
{
"path": "$.person.last_name",
"operator": "equal",
"value": "Messi"
}
]
}
}
obj = {
"person": {
"name": "Lionel",
"last_name": "Messi"
}
}
engine = RuleEngine([rule])
results = engine.evaluate(obj)
Metadata
Release files for python-rule-engine 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_rule_engine-1.0.0.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_rule_engine-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.4 kB
Release files / python_rule_engine-1.0.0.tar.gz
| Download URL | python_rule_engine-1.0.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13368b7d8b263e0a054f4518f39e42487d217a75e1448b514c6f341021a3228b
|
|
BLAKE2b-256 checksum How to use checksums |
ef5b6056e01a358049b3b362d9d8e9f9003c89c84254a3e81db24bfeecf60d41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / python_rule_engine-1.0.0-py3-none-any.whl
| Download URL | python_rule_engine-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e45a1c55ce87ecef7d401ccf7fe4a969f116445d43d40fcb12c77b1e35d77a8f
|
|
BLAKE2b-256 checksum How to use checksums |
9d2586077b41376255c79ed9ea0feda630d1116afab619a0fcaa101bedf84511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|