Skip to main content

One line expression evaluator

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corek-0.0.2.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

corek-0.0.2-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page