rule-engine-core 0.0.1__tar.gz → 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/PKG-INFO +2 -2
  2. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/README.md +1 -1
  3. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core/entity_base.py +4 -4
  4. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core/parser.py +2 -2
  5. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core.egg-info/PKG-INFO +2 -2
  6. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/setup.py +1 -1
  7. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/pyproject.toml +0 -0
  8. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core/__init__.py +0 -0
  9. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core/entity_dao.py +0 -0
  10. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core/entity_types.py +0 -0
  11. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core/filter.py +0 -0
  12. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core/metadata_store.py +0 -0
  13. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core/rule.py +0 -0
  14. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core.egg-info/SOURCES.txt +0 -0
  15. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core.egg-info/dependency_links.txt +0 -0
  16. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core.egg-info/requires.txt +0 -0
  17. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/rule_engine_core.egg-info/top_level.txt +0 -0
  18. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/setup.cfg +0 -0
  19. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/tests/test_rule_creation_storage.py +0 -0
  20. {rule_engine_core-0.0.1 → rule_engine_core-0.0.2}/tests/test_rule_evaluation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rule-engine-core
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: A rule engine core library for Python.
5
5
  Home-page: https://github.com/temp-noob/rule-engine
6
6
  Author: Mohit Tripathi
@@ -24,7 +24,7 @@ Dynamic: summary
24
24
  ## Build
25
25
  -> create venv and activate
26
26
  (install meta)
27
- -> pip install steuptools wheel twine
27
+ -> pip install setuptools wheel twine
28
28
  (build package)
29
29
  -> python setup.py sdist bdist_wheel
30
30
  -> pip install dist/rule-engine-core-0.1.0-py3-none-any.whl
@@ -1,7 +1,7 @@
1
1
  ## Build
2
2
  -> create venv and activate
3
3
  (install meta)
4
- -> pip install steuptools wheel twine
4
+ -> pip install setuptools wheel twine
5
5
  (build package)
6
6
  -> python setup.py sdist bdist_wheel
7
7
  -> pip install dist/rule-engine-core-0.1.0-py3-none-any.whl
@@ -18,7 +18,7 @@ class EntityBase(ABC):
18
18
  Initializes the entity with an expression string and parses it into an expression tree.
19
19
  """
20
20
  self.expression = expression
21
- self._expression_tree: Node = self._parse_expression(expression)
21
+ self.expression_tree: Node = self._parse_expression(expression)
22
22
  self.node_type = node_type
23
23
  self.name = name
24
24
 
@@ -27,7 +27,7 @@ class EntityBase(ABC):
27
27
  Validates whether the operands of the entity are valid.
28
28
  _validate_node must be implemented by subclasses
29
29
  """
30
- return self._validate_node(self._expression_tree)
30
+ return self._validate_node(self.expression_tree)
31
31
 
32
32
  @abstractmethod
33
33
  def _validate_node(self, node: Node) -> bool:
@@ -57,7 +57,7 @@ class EntityBase(ABC):
57
57
  entity_eval_cache: Dictionary of cached evaluation results for entities. We do a dfs sort of thing and keep on populating the cache with the results.
58
58
  entity_cache: Dictionary of cached entities. This is used to get entity object by entity id.
59
59
  """
60
- return self._evaluate_node(EntityNode(self._expression_tree, self.node_type), pos_data, entity_eval_cache, entity_cache)
60
+ return self._evaluate_node(EntityNode(self.expression_tree, self.node_type), pos_data, entity_eval_cache, entity_cache)
61
61
 
62
62
  def _parse_expression(self, expression: str) -> Node:
63
63
  """
@@ -87,7 +87,7 @@ class EntityBase(ABC):
87
87
  'expression': self.expression,
88
88
  'node_type': self.node_type,
89
89
  'name': self.name,
90
- 'expression_tree': self._expression_tree,
90
+ 'expression_tree': self.expression_tree,
91
91
  }
92
92
 
93
93
 
@@ -66,7 +66,7 @@ class Parser:
66
66
  def tokenize(self, text: str):
67
67
  # Define token specifications.
68
68
  token_spec = [
69
- ('NUMBER', r'\d+(\.\d+)?'), # Integer or decimal number
69
+ ('NUMBER', r'-?\d+(\.\d+)?'), # Integer or decimal number
70
70
  ('RELOP', r'(<=|>=|<|>)'), # Relational operators
71
71
  ('IDENT', r'[A-Za-z_]\w*'), # Identifiers (operands)
72
72
  ('OP', r'[+\-*/&|!]'), # Other operators
@@ -219,4 +219,4 @@ class Parser:
219
219
  _logger.error(errMsg)
220
220
  raise RuntimeError(errMsg)
221
221
  return node
222
-
222
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rule-engine-core
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: A rule engine core library for Python.
5
5
  Home-page: https://github.com/temp-noob/rule-engine
6
6
  Author: Mohit Tripathi
@@ -24,7 +24,7 @@ Dynamic: summary
24
24
  ## Build
25
25
  -> create venv and activate
26
26
  (install meta)
27
- -> pip install steuptools wheel twine
27
+ -> pip install setuptools wheel twine
28
28
  (build package)
29
29
  -> python setup.py sdist bdist_wheel
30
30
  -> pip install dist/rule-engine-core-0.1.0-py3-none-any.whl
@@ -14,7 +14,7 @@ def parse_requirements(filename):
14
14
  path = os.path.join(os.getenv('BUILD_PATH'), "requirements.txt")
15
15
  setup(
16
16
  name="rule-engine-core",
17
- version="0.0.1",
17
+ version="0.0.2",
18
18
  author="Mohit Tripathi",
19
19
  author_email="tripathimohit051@gmail.com",
20
20
  description="A rule engine core library for Python.",