Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 438 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 438 Bytes

Corek

An expression parser and evaluator for simple comparison expressions in Python. Only supports numeric comparisons.

Example

from corek import RulesEngine

engine = RulesEngine()

input_data = {
    'a': 10,
    'b': 2,
    'c':3
}

print(engine.evaluate_rule('a == 10', input_data)) # True
print(engine.evaluate_rule('a > 10', input_data)) # False
print(engine.evaluate_rule('(a + b) > 10', input_data)) # True