Metadata-Version: 1.2
Name: rule-engine
Version: 3.1.2
Summary: A lightweight, optionally typed expression language with a custom grammar for matching arbitrary Python objects.
Home-page: https://github.com/zeroSteiner/rule-engine
Author: Spencer McIntyre
Author-email: zeroSteiner@gmail.com
Maintainer: Spencer McIntyre
Maintainer-email: zeroSteiner@gmail.com
License: BSD
Description: Rule Engine
        ===========
        A lightweight, optionally typed expression language with a custom grammar for matching arbitrary Python objects.
        
        Documentation is available at https://zeroSteiner.github.io/rule-engine/.
        
        Rule Engine expressions are written in their own language, defined as strings in Python. Some features of this language
        includes:
        
        - Optional type hinting
        - Matching strings with regular expressions
        - Datetime datatypes
        - Data attributes
        
        Example
        -------
        The following example demonstrates the basic usage of defining a rule object and applying it to two dictionaries,
        showing that one matches while the other does not. See `Getting Started`_ for more information.
        
        .. code-block:: python
        
           import rule_engine
           # match a literal first name and applying a regex to the email
           rule = rule_engine.Rule(
               'first_name == "Luke" and email =~ ".*@rebels.org$"'
           ) # => <Rule text='first_name == "Luke" and email =~ ".*@rebels.org$"' >
           rule.matches({
               'first_name': 'Luke', 'last_name': 'Skywalker', 'email': 'luke@rebels.org'
           }) # => True
           rule.matches({
              'first_name': 'Darth', 'last_name': 'Vader', 'email': 'dvader@empire.net'
           }) # => False
        
        The next example demonstrates the optional type system. A custom context is created that defines two symbols, one string
        and one float. Because symbols are defined, an exception will be raised if an unknown symbol is specified or an invalid
        operation is used. See `Type Hinting`_ for more information.
        
        .. code-block:: python
        
           import rule_engine
           # define the custom context with two symbols
           context = rule_engine.Context(type_resolver=rule_engine.type_resolver_from_dict({
               'first_name': rule_engine.DataType.STRING,
               'age': rule_engine.DataType.FLOAT
           }))
        
           # receive an error when an unknown symbol is used
           rule = rule_engine.Rule('last_name == "Vader"', context=context)
           # => SymbolResolutionError: last_name
        
           # receive an error when an invalid operation is used
           rule = rule_engine.Rule('first_name + 1', context=context)
           # => EvaluationError: data type mismatch
        
        Want to give the rule expression language a try? Checkout the `Debug REPL`_ that makes experimentation easy. After
        installing just run ``python -m rule_engine.debug_repl``.
        
        Credits
        -------
        * Spencer McIntyre - zeroSteiner (`@zeroSteiner <https://twitter.com/zeroSteiner>`_)
        
        .. _Getting Started: https://zerosteiner.github.io/rule-engine/getting_started.html
        .. _Type Hinting: https://zerosteiner.github.io/rule-engine/getting_started.html#type-hinting
        .. _Debug REPL: https://zerosteiner.github.io/rule-engine/debug_repl.html
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
