rule-engine 4.5.2__tar.gz → 5.0.0__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 (59) hide show
  1. {rule_engine-4.5.2 → rule_engine-5.0.0}/PKG-INFO +10 -25
  2. {rule_engine-4.5.2 → rule_engine-5.0.0}/README.rst +2 -2
  3. {rule_engine-4.5.2 → rule_engine-5.0.0}/lib/rule_engine/__init__.py +19 -1
  4. rule_engine-5.0.0/lib/rule_engine/_vendor/__init__.py +4 -0
  5. rule_engine-5.0.0/lib/rule_engine/_vendor/ply/LICENSE +32 -0
  6. rule_engine-5.0.0/lib/rule_engine/_vendor/ply/__init__.py +5 -0
  7. rule_engine-5.0.0/lib/rule_engine/_vendor/ply/lex.py +1098 -0
  8. rule_engine-5.0.0/lib/rule_engine/_vendor/ply/yacc.py +3433 -0
  9. rule_engine-5.0.0/lib/rule_engine/ast/__init__.py +92 -0
  10. rule_engine-5.0.0/lib/rule_engine/ast/base.py +343 -0
  11. rule_engine-5.0.0/lib/rule_engine/ast/binary/__init__.py +103 -0
  12. rule_engine-5.0.0/lib/rule_engine/ast/binary/arithmetic.py +211 -0
  13. rule_engine-5.0.0/lib/rule_engine/ast/binary/base.py +112 -0
  14. rule_engine-5.0.0/lib/rule_engine/ast/binary/comparison.py +154 -0
  15. rule_engine-5.0.0/lib/rule_engine/ast/expression/__init__.py +35 -0
  16. rule_engine-5.0.0/lib/rule_engine/ast/expression/access.py +434 -0
  17. rule_engine-5.0.0/lib/rule_engine/ast/expression/control.py +256 -0
  18. rule_engine-5.0.0/lib/rule_engine/ast/expression/resolution.py +220 -0
  19. rule_engine-5.0.0/lib/rule_engine/ast/literal.py +183 -0
  20. rule_engine-5.0.0/lib/rule_engine/builtins.py +230 -0
  21. {rule_engine-4.5.2 → rule_engine-5.0.0}/lib/rule_engine/debug_ast.py +19 -19
  22. rule_engine-5.0.0/lib/rule_engine/debug_repl.py +159 -0
  23. rule_engine-5.0.0/lib/rule_engine/engine/__init__.py +34 -0
  24. rule_engine-5.0.0/lib/rule_engine/engine/_attribute_resolver.py +353 -0
  25. rule_engine-5.0.0/lib/rule_engine/engine/context.py +438 -0
  26. rule_engine-5.0.0/lib/rule_engine/engine/rule.py +148 -0
  27. rule_engine-5.0.0/lib/rule_engine/errors.py +359 -0
  28. rule_engine-5.0.0/lib/rule_engine/parser/__init__.py +614 -0
  29. rule_engine-5.0.0/lib/rule_engine/parser/base.py +86 -0
  30. rule_engine-5.0.0/lib/rule_engine/parser/utilities.py +114 -0
  31. rule_engine-5.0.0/lib/rule_engine/suggestions.py +105 -0
  32. rule_engine-5.0.0/lib/rule_engine/types/__init__.py +61 -0
  33. rule_engine-5.0.0/lib/rule_engine/types/_object.py +318 -0
  34. rule_engine-5.0.0/lib/rule_engine/types/coercion.py +141 -0
  35. rule_engine-5.0.0/lib/rule_engine/types/dataclass.py +149 -0
  36. rule_engine-5.0.0/lib/rule_engine/types/datatype.py +398 -0
  37. rule_engine-5.0.0/lib/rule_engine/types/definitions.py +454 -0
  38. rule_engine-5.0.0/lib/rule_engine/types/sqlalchemy.py +171 -0
  39. {rule_engine-4.5.2 → rule_engine-5.0.0}/lib/rule_engine.egg-info/PKG-INFO +10 -25
  40. rule_engine-5.0.0/lib/rule_engine.egg-info/SOURCES.txt +44 -0
  41. {rule_engine-4.5.2 → rule_engine-5.0.0}/lib/rule_engine.egg-info/requires.txt +0 -1
  42. rule_engine-5.0.0/pyproject.toml +90 -0
  43. rule_engine-4.5.2/lib/rule_engine/ast.py +0 -1274
  44. rule_engine-4.5.2/lib/rule_engine/builtins.py +0 -214
  45. rule_engine-4.5.2/lib/rule_engine/debug_repl.py +0 -144
  46. rule_engine-4.5.2/lib/rule_engine/engine.py +0 -675
  47. rule_engine-4.5.2/lib/rule_engine/errors.py +0 -311
  48. rule_engine-4.5.2/lib/rule_engine/parser/__init__.py +0 -564
  49. rule_engine-4.5.2/lib/rule_engine/parser/base.py +0 -82
  50. rule_engine-4.5.2/lib/rule_engine/parser/parsetab.py +0 -98
  51. rule_engine-4.5.2/lib/rule_engine/parser/utilities.py +0 -115
  52. rule_engine-4.5.2/lib/rule_engine/suggestions.py +0 -102
  53. rule_engine-4.5.2/lib/rule_engine/types.py +0 -618
  54. rule_engine-4.5.2/lib/rule_engine.egg-info/SOURCES.txt +0 -21
  55. rule_engine-4.5.2/setup.py +0 -99
  56. {rule_engine-4.5.2 → rule_engine-5.0.0}/LICENSE +0 -0
  57. {rule_engine-4.5.2 → rule_engine-5.0.0}/lib/rule_engine.egg-info/dependency_links.txt +0 -0
  58. {rule_engine-4.5.2 → rule_engine-5.0.0}/lib/rule_engine.egg-info/top_level.txt +0 -0
  59. {rule_engine-4.5.2 → rule_engine-5.0.0}/setup.cfg +0 -0
@@ -1,41 +1,26 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: rule-engine
3
- Version: 4.5.2
3
+ Version: 5.0.0
4
4
  Summary: A lightweight, optionally typed expression language with a custom grammar for matching arbitrary Python objects.
5
- Home-page: https://github.com/zeroSteiner/rule-engine
6
- Author: Spencer McIntyre
7
- Author-email: zeroSteiner@gmail.com
8
- Maintainer: Spencer McIntyre
9
- Maintainer-email: zeroSteiner@gmail.com
5
+ Author-email: Spencer McIntyre <zeroSteiner@gmail.com>
6
+ Maintainer-email: Spencer McIntyre <zeroSteiner@gmail.com>
10
7
  License: BSD
8
+ Project-URL: Homepage, https://github.com/zeroSteiner/rule-engine
11
9
  Classifier: Development Status :: 5 - Production/Stable
12
10
  Classifier: Environment :: Console
13
11
  Classifier: Intended Audience :: Developers
14
12
  Classifier: License :: OSI Approved :: BSD License
15
13
  Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3.6
17
- Classifier: Programming Language :: Python :: 3.7
18
- Classifier: Programming Language :: Python :: 3.8
19
- Classifier: Programming Language :: Python :: 3.9
20
14
  Classifier: Programming Language :: Python :: 3.10
21
15
  Classifier: Programming Language :: Python :: 3.11
22
16
  Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
23
18
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.10
24
20
  Description-Content-Type: text/x-rst
25
21
  License-File: LICENSE
26
- Requires-Dist: ply>=3.9
27
22
  Requires-Dist: python-dateutil~=2.7
28
- Dynamic: author
29
- Dynamic: author-email
30
- Dynamic: classifier
31
- Dynamic: description
32
- Dynamic: description-content-type
33
- Dynamic: home-page
34
- Dynamic: license
35
- Dynamic: maintainer
36
- Dynamic: maintainer-email
37
- Dynamic: requires-dist
38
- Dynamic: summary
23
+ Dynamic: license-file
39
24
 
40
25
  Rule Engine
41
26
  ===========
@@ -46,8 +31,8 @@ A lightweight, optionally typed expression language with a custom grammar for ma
46
31
  Documentation is available at https://zeroSteiner.github.io/rule-engine/.
47
32
 
48
33
  :Warning:
49
- The next major version (5.0) will remove support Python versions 3.6, 3.7 and 3.8. There is currently no timeline for
50
- its release.
34
+ Version 5.0 removes support for Python versions 3.6, 3.7, 3.8, and 3.9 and deprecates attribute-style access on
35
+ ``MAPPING`` values (use bracket syntax ``mapping["key"]`` instead). See the `Change Log`_ for details.
51
36
 
52
37
  Rule Engine expressions are written in their own language, defined as strings in Python. The syntax is most similar to
53
38
  Python with some inspiration from Ruby. Some features of this language includes:
@@ -7,8 +7,8 @@ A lightweight, optionally typed expression language with a custom grammar for ma
7
7
  Documentation is available at https://zeroSteiner.github.io/rule-engine/.
8
8
 
9
9
  :Warning:
10
- The next major version (5.0) will remove support Python versions 3.6, 3.7 and 3.8. There is currently no timeline for
11
- its release.
10
+ Version 5.0 removes support for Python versions 3.6, 3.7, 3.8, and 3.9 and deprecates attribute-style access on
11
+ ``MAPPING`` values (use bracket syntax ``mapping["key"]`` instead). See the `Change Log`_ for details.
12
12
 
13
13
  Rule Engine expressions are written in their own language, defined as strings in Python. The syntax is most similar to
14
14
  Python with some inspiration from Ruby. Some features of this language includes:
@@ -30,11 +30,13 @@
30
30
  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
31
  #
32
32
 
33
- __version__ = '4.5.2'
33
+ __version__ = '5.0.0'
34
34
 
35
35
  from .engine import resolve_attribute
36
36
  from .engine import resolve_item
37
+ from .engine import type_resolver_from_dataclass
37
38
  from .engine import type_resolver_from_dict
39
+ from .engine import type_resolver_from_sqlalchemy
38
40
  from .engine import Context
39
41
  from .engine import Rule
40
42
 
@@ -45,3 +47,19 @@ from .errors import RuleSyntaxError
45
47
  from .errors import SymbolResolutionError
46
48
 
47
49
  from .types import DataType
50
+
51
+ __all__ = (
52
+ 'AttributeResolutionError',
53
+ 'Context',
54
+ 'DataType',
55
+ 'EngineError',
56
+ 'EvaluationError',
57
+ 'Rule',
58
+ 'RuleSyntaxError',
59
+ 'SymbolResolutionError',
60
+ 'resolve_attribute',
61
+ 'resolve_item',
62
+ 'type_resolver_from_dataclass',
63
+ 'type_resolver_from_dict',
64
+ 'type_resolver_from_sqlalchemy',
65
+ )
@@ -0,0 +1,4 @@
1
+ """
2
+ Private, vendored third-party dependencies. Nothing in this subpackage is part
3
+ of the public API and it must not be imported by users of :mod:`rule_engine`.
4
+ """
@@ -0,0 +1,32 @@
1
+ # PLY (Python Lex-Yacc) Version 3.11
2
+
3
+ [![Build Status](https://travis-ci.org/dabeaz/ply.svg?branch=master)](https://travis-ci.org/dabeaz/ply)
4
+
5
+ Copyright (C) 2001-2018
6
+ David M. Beazley (Dabeaz LLC)
7
+ All rights reserved.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are
11
+ met:
12
+
13
+ * Redistributions of source code must retain the above copyright notice,
14
+ this list of conditions and the following disclaimer.
15
+ * Redistributions in binary form must reproduce the above copyright notice,
16
+ this list of conditions and the following disclaimer in the documentation
17
+ and/or other materials provided with the distribution.
18
+ * Neither the name of the David Beazley or Dabeaz LLC may be used to
19
+ endorse or promote products derived from this software without
20
+ specific prior written permission.
21
+
22
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,5 @@
1
+ # PLY package
2
+ # Author: David Beazley (dave@dabeaz.com)
3
+
4
+ __version__ = '3.11'
5
+ __all__ = ['lex','yacc']