math-engine 0.6.1__tar.gz → 0.6.3__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.
- {math_engine-0.6.1 → math_engine-0.6.3}/PKG-INFO +7 -7
- {math_engine-0.6.1 → math_engine-0.6.3}/README.md +6 -6
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/__init__.py +4 -4
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/config.json +1 -1
- math_engine-0.6.3/math_engine/plugin_manager.py +38 -0
- math_engine-0.6.3/math_engine/plugins/__init__.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine.egg-info/PKG-INFO +7 -7
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine.egg-info/SOURCES.txt +3 -1
- {math_engine-0.6.1 → math_engine-0.6.3}/pyproject.toml +1 -1
- {math_engine-0.6.1 → math_engine-0.6.3}/LICENSE +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/AST_Node_Types.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/ScientificEngine.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/calculator.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/cli.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/config_manager.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/error.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/non_decimal_utility.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine/utility.py +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine.egg-info/dependency_links.txt +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine.egg-info/entry_points.txt +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/math_engine.egg-info/top_level.txt +0 -0
- {math_engine-0.6.1 → math_engine-0.6.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: math-engine
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: A fast and secure mathematical expression evaluator.
|
|
5
5
|
Author-email: Jan Teske <jan.teske.06@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/JanTeske06/math_engine
|
|
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
# Math Engine v0.6.
|
|
17
|
+
# Math Engine v0.6.3
|
|
18
18
|
|
|
19
19
|
[](https://pypi.org/project/math-engine/)
|
|
20
20
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -84,7 +84,7 @@ pip install math-engine
|
|
|
84
84
|
|
|
85
85
|
# Command Line Interface (CLI)
|
|
86
86
|
|
|
87
|
-
Math Engine works directly from your terminal
|
|
87
|
+
Math Engine works directly from your terminal! After installing via pip, you can use the command `math-engine`, `calc` or `start`.
|
|
88
88
|
|
|
89
89
|
### 1\. Interactive Mode (REPL)
|
|
90
90
|
|
|
@@ -93,7 +93,7 @@ Start the shell to calculate, manage variables, and change settings dynamically.
|
|
|
93
93
|
```bash
|
|
94
94
|
$ math-engine
|
|
95
95
|
|
|
96
|
-
Math Engine 0.
|
|
96
|
+
Math Engine 0.6.3 Interactive Shell
|
|
97
97
|
Type 'help' for commands, 'exit' to leave.
|
|
98
98
|
----------------------------------------
|
|
99
99
|
Examples:
|
|
@@ -393,7 +393,7 @@ preset = {
|
|
|
393
393
|
"word_size": 0, # 0 = unlimited, or 8, 16, 32, 64
|
|
394
394
|
"signed_mode": True, # True = Two's Complement, False = Unsigned
|
|
395
395
|
# New in 0.6.0
|
|
396
|
-
"readable_error":
|
|
396
|
+
"readable_error": True
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
math_engine.load_preset(preset)
|
|
@@ -433,7 +433,7 @@ math_engine.evaluate("sin(5")
|
|
|
433
433
|
|
|
434
434
|
```text
|
|
435
435
|
Errormessage: Unbalanced parenthesis.
|
|
436
|
-
Code:
|
|
436
|
+
Code: 3009
|
|
437
437
|
Equation: sin(5
|
|
438
438
|
^ HERE IS THE PROBLEM (Position: 5)
|
|
439
439
|
```
|
|
@@ -490,7 +490,7 @@ def test_division_by_zero():
|
|
|
490
490
|
assert exc.value.position_start == 3
|
|
491
491
|
```
|
|
492
492
|
|
|
493
|
-
|
|
493
|
+
## Example Error Codes
|
|
494
494
|
|
|
495
495
|
| Code | Meaning |
|
|
496
496
|
| ---- | --------------------------- |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
# Math Engine v0.6.
|
|
2
|
+
# Math Engine v0.6.3
|
|
3
3
|
|
|
4
4
|
[](https://pypi.org/project/math-engine/)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -69,7 +69,7 @@ pip install math-engine
|
|
|
69
69
|
|
|
70
70
|
# Command Line Interface (CLI)
|
|
71
71
|
|
|
72
|
-
Math Engine works directly from your terminal
|
|
72
|
+
Math Engine works directly from your terminal! After installing via pip, you can use the command `math-engine`, `calc` or `start`.
|
|
73
73
|
|
|
74
74
|
### 1\. Interactive Mode (REPL)
|
|
75
75
|
|
|
@@ -78,7 +78,7 @@ Start the shell to calculate, manage variables, and change settings dynamically.
|
|
|
78
78
|
```bash
|
|
79
79
|
$ math-engine
|
|
80
80
|
|
|
81
|
-
Math Engine 0.
|
|
81
|
+
Math Engine 0.6.3 Interactive Shell
|
|
82
82
|
Type 'help' for commands, 'exit' to leave.
|
|
83
83
|
----------------------------------------
|
|
84
84
|
Examples:
|
|
@@ -378,7 +378,7 @@ preset = {
|
|
|
378
378
|
"word_size": 0, # 0 = unlimited, or 8, 16, 32, 64
|
|
379
379
|
"signed_mode": True, # True = Two's Complement, False = Unsigned
|
|
380
380
|
# New in 0.6.0
|
|
381
|
-
"readable_error":
|
|
381
|
+
"readable_error": True
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
math_engine.load_preset(preset)
|
|
@@ -418,7 +418,7 @@ math_engine.evaluate("sin(5")
|
|
|
418
418
|
|
|
419
419
|
```text
|
|
420
420
|
Errormessage: Unbalanced parenthesis.
|
|
421
|
-
Code:
|
|
421
|
+
Code: 3009
|
|
422
422
|
Equation: sin(5
|
|
423
423
|
^ HERE IS THE PROBLEM (Position: 5)
|
|
424
424
|
```
|
|
@@ -475,7 +475,7 @@ def test_division_by_zero():
|
|
|
475
475
|
assert exc.value.position_start == 3
|
|
476
476
|
```
|
|
477
477
|
|
|
478
|
-
|
|
478
|
+
## Example Error Codes
|
|
479
479
|
|
|
480
480
|
| Code | Meaning |
|
|
481
481
|
| ---- | --------------------------- |
|
|
@@ -8,7 +8,7 @@ from . import error as E
|
|
|
8
8
|
from typing import Any, Mapping, Optional
|
|
9
9
|
from typing import Union
|
|
10
10
|
from typing import Any, Mapping
|
|
11
|
-
__version__ = "0.6.
|
|
11
|
+
__version__ = "0.6.3"
|
|
12
12
|
memory = {}
|
|
13
13
|
|
|
14
14
|
def set_memory(key_value: str, value:str):
|
|
@@ -103,9 +103,9 @@ def evaluate(expr: str,
|
|
|
103
103
|
else:
|
|
104
104
|
print((positon_start + 4) * " " + "^ HERE IS THE PROBLEM (Position: " + str(
|
|
105
105
|
positon_start) + ")")
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
print(code + str(e.code))
|
|
107
|
+
print(Errormessage + str(e.message))
|
|
108
|
+
print(" ")
|
|
109
109
|
else:
|
|
110
110
|
print(code + str(e.code))
|
|
111
111
|
print(Errormessage + str(e.message))
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from abc import ABC, abstractmethod
|
|
3
|
+
from decimal import Decimal
|
|
4
|
+
|
|
5
|
+
class BasePlugin(ABC):
|
|
6
|
+
|
|
7
|
+
@property
|
|
8
|
+
@abstractmethod
|
|
9
|
+
def min_args(self) -> int:
|
|
10
|
+
pass
|
|
11
|
+
|
|
12
|
+
@abstractmethod
|
|
13
|
+
def get_name(self) -> str:
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
@abstractmethod
|
|
17
|
+
def execute(self, args: list) -> Decimal:
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
def get_help(self) -> str:
|
|
21
|
+
return "Keine Hilfe verfügbar."
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def find_plugins():
|
|
25
|
+
plugin_ordner = Path("./plugins")
|
|
26
|
+
if not plugin_ordner.exists():
|
|
27
|
+
print("Warnung: Kein 'plugins' Ordner gefunden!")
|
|
28
|
+
return []
|
|
29
|
+
|
|
30
|
+
print(f"Scanne Ordner: {plugin_ordner.absolute()}")
|
|
31
|
+
for datei in plugin_ordner.glob("*.py"):
|
|
32
|
+
if datei.name == "__init__.py":
|
|
33
|
+
continue
|
|
34
|
+
print(f"Plugin-Datei entdeckt: {datei.name}")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def load_plugin():
|
|
38
|
+
print("x")
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: math-engine
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: A fast and secure mathematical expression evaluator.
|
|
5
5
|
Author-email: Jan Teske <jan.teske.06@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/JanTeske06/math_engine
|
|
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
# Math Engine v0.6.
|
|
17
|
+
# Math Engine v0.6.3
|
|
18
18
|
|
|
19
19
|
[](https://pypi.org/project/math-engine/)
|
|
20
20
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -84,7 +84,7 @@ pip install math-engine
|
|
|
84
84
|
|
|
85
85
|
# Command Line Interface (CLI)
|
|
86
86
|
|
|
87
|
-
Math Engine works directly from your terminal
|
|
87
|
+
Math Engine works directly from your terminal! After installing via pip, you can use the command `math-engine`, `calc` or `start`.
|
|
88
88
|
|
|
89
89
|
### 1\. Interactive Mode (REPL)
|
|
90
90
|
|
|
@@ -93,7 +93,7 @@ Start the shell to calculate, manage variables, and change settings dynamically.
|
|
|
93
93
|
```bash
|
|
94
94
|
$ math-engine
|
|
95
95
|
|
|
96
|
-
Math Engine 0.
|
|
96
|
+
Math Engine 0.6.3 Interactive Shell
|
|
97
97
|
Type 'help' for commands, 'exit' to leave.
|
|
98
98
|
----------------------------------------
|
|
99
99
|
Examples:
|
|
@@ -393,7 +393,7 @@ preset = {
|
|
|
393
393
|
"word_size": 0, # 0 = unlimited, or 8, 16, 32, 64
|
|
394
394
|
"signed_mode": True, # True = Two's Complement, False = Unsigned
|
|
395
395
|
# New in 0.6.0
|
|
396
|
-
"readable_error":
|
|
396
|
+
"readable_error": True
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
math_engine.load_preset(preset)
|
|
@@ -433,7 +433,7 @@ math_engine.evaluate("sin(5")
|
|
|
433
433
|
|
|
434
434
|
```text
|
|
435
435
|
Errormessage: Unbalanced parenthesis.
|
|
436
|
-
Code:
|
|
436
|
+
Code: 3009
|
|
437
437
|
Equation: sin(5
|
|
438
438
|
^ HERE IS THE PROBLEM (Position: 5)
|
|
439
439
|
```
|
|
@@ -490,7 +490,7 @@ def test_division_by_zero():
|
|
|
490
490
|
assert exc.value.position_start == 3
|
|
491
491
|
```
|
|
492
492
|
|
|
493
|
-
|
|
493
|
+
## Example Error Codes
|
|
494
494
|
|
|
495
495
|
| Code | Meaning |
|
|
496
496
|
| ---- | --------------------------- |
|
|
@@ -10,9 +10,11 @@ math_engine/config.json
|
|
|
10
10
|
math_engine/config_manager.py
|
|
11
11
|
math_engine/error.py
|
|
12
12
|
math_engine/non_decimal_utility.py
|
|
13
|
+
math_engine/plugin_manager.py
|
|
13
14
|
math_engine/utility.py
|
|
14
15
|
math_engine.egg-info/PKG-INFO
|
|
15
16
|
math_engine.egg-info/SOURCES.txt
|
|
16
17
|
math_engine.egg-info/dependency_links.txt
|
|
17
18
|
math_engine.egg-info/entry_points.txt
|
|
18
|
-
math_engine.egg-info/top_level.txt
|
|
19
|
+
math_engine.egg-info/top_level.txt
|
|
20
|
+
math_engine/plugins/__init__.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|