azrideus-mathparse 0.2.9__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.
- azrideus_mathparse-0.2.9/LICENSE +21 -0
- azrideus_mathparse-0.2.9/PKG-INFO +125 -0
- azrideus_mathparse-0.2.9/README.md +99 -0
- azrideus_mathparse-0.2.9/azrideus_mathparse.egg-info/PKG-INFO +125 -0
- azrideus_mathparse-0.2.9/azrideus_mathparse.egg-info/SOURCES.txt +19 -0
- azrideus_mathparse-0.2.9/azrideus_mathparse.egg-info/dependency_links.txt +1 -0
- azrideus_mathparse-0.2.9/azrideus_mathparse.egg-info/requires.txt +4 -0
- azrideus_mathparse-0.2.9/azrideus_mathparse.egg-info/top_level.txt +1 -0
- azrideus_mathparse-0.2.9/mathparse/__init__.py +5 -0
- azrideus_mathparse-0.2.9/mathparse/mathparse.py +890 -0
- azrideus_mathparse-0.2.9/mathparse/mathwords.py +1777 -0
- azrideus_mathparse-0.2.9/pyproject.toml +60 -0
- azrideus_mathparse-0.2.9/setup.cfg +4 -0
- azrideus_mathparse-0.2.9/tests/test_binary_operations.py +174 -0
- azrideus_mathparse-0.2.9/tests/test_complex_statements.py +80 -0
- azrideus_mathparse-0.2.9/tests/test_language_support.py +34 -0
- azrideus_mathparse-0.2.9/tests/test_prefix_unary_operations.py +409 -0
- azrideus_mathparse-0.2.9/tests/test_replace_word_tokens.py +85 -0
- azrideus_mathparse-0.2.9/tests/test_simplified_chinese.py +167 -0
- azrideus_mathparse-0.2.9/tests/test_unary_operations.py +221 -0
- azrideus_mathparse-0.2.9/tests/test_utils.py +117 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Gunther Cox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: azrideus-mathparse
|
|
3
|
+
Version: 0.2.9
|
|
4
|
+
Summary: A fork of mathparse (https://github.com/gunthercox/mathparse) for my own usage; a library for solving mathematical equations contained in strings
|
|
5
|
+
Author: Gunther Cox
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Documentation, https://mathparse.chatterbot.us
|
|
8
|
+
Project-URL: Repository, https://github.com/gunthercox/mathparse
|
|
9
|
+
Project-URL: Changelog, https://github.com/gunthercox/mathparse/releases
|
|
10
|
+
Keywords: mathparse,mathematics,math,nlp,calculator,expression-parser,eval-alternative,safe-eval,multilingual,natural-language,postfix-notation,reverse-polish-notation,rpn,math-parser,expression-evaluator,secure-evaluation,language-processing,mathematical-expressions,formula-parser
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
16
|
+
Classifier: Topic :: Text Processing :: General
|
|
17
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
19
|
+
Requires-Python: <3.15,>=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: flake8; extra == "test"
|
|
24
|
+
Requires-Dist: sphinx<9.0,>=7.4; extra == "test"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# mathparse
|
|
28
|
+
|
|
29
|
+
**A secure, multilingual mathematical expression evaluator for Python**
|
|
30
|
+
|
|
31
|
+
`mathparse` is a Python library that safely parses and evaluates mathematical expressions from strings, supporting both numeric operators and natural language words across 13+ languages. Unlike Python's dangerous `eval()` function, mathparse provides a secure, zero-dependency solution for evaluating user-provided mathematical expressions.
|
|
32
|
+
|
|
33
|
+
## Why mathparse?
|
|
34
|
+
|
|
35
|
+
✅ **Security First** - Never uses `eval()`, protecting against arbitrary code execution
|
|
36
|
+
✅ **Multilingual Support** - Parse math in English, Spanish, French, German, Chinese, and 8+ more languages
|
|
37
|
+
✅ **Zero Dependencies** - Pure Python implementation with no external requirements
|
|
38
|
+
✅ **Natural Language** - Understands "fifty times twenty plus ten" alongside standard notation
|
|
39
|
+
✅ **Production Ready** - Used in chatbots, calculators, voice assistants, and educational applications
|
|
40
|
+
✅ **Well Tested** - Comprehensive test suite ensuring reliability
|
|
41
|
+
|
|
42
|
+
## Quick Examples
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from mathparse import mathparse
|
|
46
|
+
|
|
47
|
+
# Standard numeric expressions
|
|
48
|
+
mathparse.parse('50 * (85 / 100)')
|
|
49
|
+
>>> 42.5
|
|
50
|
+
|
|
51
|
+
# Natural language in English
|
|
52
|
+
mathparse.parse('one hundred times fifty four', language='ENG')
|
|
53
|
+
>>> 5400
|
|
54
|
+
|
|
55
|
+
# Mixed notation
|
|
56
|
+
mathparse.parse('(seven * nine) + 8 - (45 plus two)', language='ENG')
|
|
57
|
+
>>> 24
|
|
58
|
+
|
|
59
|
+
# Other languages (French, Spanish, German, Chinese, etc.)
|
|
60
|
+
mathparse.parse('cinq plus trois', language='FRE')
|
|
61
|
+
>>> 8
|
|
62
|
+
|
|
63
|
+
mathparse.parse('cinco más tres', language='ESP')
|
|
64
|
+
>>> 8
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Use Cases
|
|
68
|
+
|
|
69
|
+
- 🤖 **Chatbots & Voice Assistants** - Parse natural language math queries
|
|
70
|
+
- 🧮 **Calculator Applications** - Build safe calculators that accept text input
|
|
71
|
+
- 📚 **Educational Software** - Evaluate student-provided math expressions
|
|
72
|
+
- 🌐 **Multilingual Apps** - Support math parsing in users' native languages
|
|
73
|
+
- 🔐 **Secure Code Evaluation** - Replace dangerous `eval()` calls with safe parsing
|
|
74
|
+
- 📊 **Data Processing** - Extract and calculate values from natural language text
|
|
75
|
+
|
|
76
|
+
## Security: Why Not eval()?
|
|
77
|
+
|
|
78
|
+
Python's `eval()` function executes arbitrary code, creating severe security vulnerabilities:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
# DANGEROUS - Never do this with user input!
|
|
82
|
+
eval("__import__('os').system('rm -rf /')") # Deletes files
|
|
83
|
+
eval("__import__('requests').get('evil.com')") # Network access
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**mathparse is the safe alternative:**
|
|
87
|
+
|
|
88
|
+
| Feature | eval() | mathparse |
|
|
89
|
+
|---------|--------|-----------|
|
|
90
|
+
| Mathematical expressions | ✅ | ✅ |
|
|
91
|
+
| Arbitrary code execution | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
92
|
+
| File system access | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
93
|
+
| Network access | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
94
|
+
| Import statements | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
95
|
+
| Security risk | 🔴 **CRITICAL** | 🟢 Safe |
|
|
96
|
+
| Dependencies | 0 | 0 |
|
|
97
|
+
| Natural language support | ❌ No | ✅ Yes |
|
|
98
|
+
| Multilingual | ❌ No | ✅ 13+ languages |
|
|
99
|
+
|
|
100
|
+
mathparse uses [postfix (Reverse Polish) notation](https://mathparse.chatterbot.us/postfix/) internally, ensuring only valid mathematical operations are performed. See our [security documentation](https://mathparse.chatterbot.us/postfix/) for technical details.
|
|
101
|
+
|
|
102
|
+
## Performance
|
|
103
|
+
|
|
104
|
+
- **Fast**: Simple numeric expressions parse in microseconds
|
|
105
|
+
- **Efficient**: Minimal memory footprint, suitable for high-volume applications
|
|
106
|
+
- **Scalable**: Linear time complexity for expression evaluation
|
|
107
|
+
|
|
108
|
+
## Language Support
|
|
109
|
+
|
|
110
|
+
The language parameter must be set in order to evaluate an equation that uses word operators.
|
|
111
|
+
The language code should be a valid [ISO 639-2](https://www.loc.gov/standards/iso639-2/php/code_list.php) language code.
|
|
112
|
+
|
|
113
|
+
## Installation
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pip install mathparse
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Documentation
|
|
120
|
+
|
|
121
|
+
See the full documentation at https://mathparse.chatterbot.us
|
|
122
|
+
|
|
123
|
+
## Changelog
|
|
124
|
+
|
|
125
|
+
See [release notes](https://github.com/gunthercox/mathparse/releases) for changes.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# mathparse
|
|
2
|
+
|
|
3
|
+
**A secure, multilingual mathematical expression evaluator for Python**
|
|
4
|
+
|
|
5
|
+
`mathparse` is a Python library that safely parses and evaluates mathematical expressions from strings, supporting both numeric operators and natural language words across 13+ languages. Unlike Python's dangerous `eval()` function, mathparse provides a secure, zero-dependency solution for evaluating user-provided mathematical expressions.
|
|
6
|
+
|
|
7
|
+
## Why mathparse?
|
|
8
|
+
|
|
9
|
+
✅ **Security First** - Never uses `eval()`, protecting against arbitrary code execution
|
|
10
|
+
✅ **Multilingual Support** - Parse math in English, Spanish, French, German, Chinese, and 8+ more languages
|
|
11
|
+
✅ **Zero Dependencies** - Pure Python implementation with no external requirements
|
|
12
|
+
✅ **Natural Language** - Understands "fifty times twenty plus ten" alongside standard notation
|
|
13
|
+
✅ **Production Ready** - Used in chatbots, calculators, voice assistants, and educational applications
|
|
14
|
+
✅ **Well Tested** - Comprehensive test suite ensuring reliability
|
|
15
|
+
|
|
16
|
+
## Quick Examples
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from mathparse import mathparse
|
|
20
|
+
|
|
21
|
+
# Standard numeric expressions
|
|
22
|
+
mathparse.parse('50 * (85 / 100)')
|
|
23
|
+
>>> 42.5
|
|
24
|
+
|
|
25
|
+
# Natural language in English
|
|
26
|
+
mathparse.parse('one hundred times fifty four', language='ENG')
|
|
27
|
+
>>> 5400
|
|
28
|
+
|
|
29
|
+
# Mixed notation
|
|
30
|
+
mathparse.parse('(seven * nine) + 8 - (45 plus two)', language='ENG')
|
|
31
|
+
>>> 24
|
|
32
|
+
|
|
33
|
+
# Other languages (French, Spanish, German, Chinese, etc.)
|
|
34
|
+
mathparse.parse('cinq plus trois', language='FRE')
|
|
35
|
+
>>> 8
|
|
36
|
+
|
|
37
|
+
mathparse.parse('cinco más tres', language='ESP')
|
|
38
|
+
>>> 8
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Use Cases
|
|
42
|
+
|
|
43
|
+
- 🤖 **Chatbots & Voice Assistants** - Parse natural language math queries
|
|
44
|
+
- 🧮 **Calculator Applications** - Build safe calculators that accept text input
|
|
45
|
+
- 📚 **Educational Software** - Evaluate student-provided math expressions
|
|
46
|
+
- 🌐 **Multilingual Apps** - Support math parsing in users' native languages
|
|
47
|
+
- 🔐 **Secure Code Evaluation** - Replace dangerous `eval()` calls with safe parsing
|
|
48
|
+
- 📊 **Data Processing** - Extract and calculate values from natural language text
|
|
49
|
+
|
|
50
|
+
## Security: Why Not eval()?
|
|
51
|
+
|
|
52
|
+
Python's `eval()` function executes arbitrary code, creating severe security vulnerabilities:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
# DANGEROUS - Never do this with user input!
|
|
56
|
+
eval("__import__('os').system('rm -rf /')") # Deletes files
|
|
57
|
+
eval("__import__('requests').get('evil.com')") # Network access
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**mathparse is the safe alternative:**
|
|
61
|
+
|
|
62
|
+
| Feature | eval() | mathparse |
|
|
63
|
+
|---------|--------|-----------|
|
|
64
|
+
| Mathematical expressions | ✅ | ✅ |
|
|
65
|
+
| Arbitrary code execution | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
66
|
+
| File system access | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
67
|
+
| Network access | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
68
|
+
| Import statements | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
69
|
+
| Security risk | 🔴 **CRITICAL** | 🟢 Safe |
|
|
70
|
+
| Dependencies | 0 | 0 |
|
|
71
|
+
| Natural language support | ❌ No | ✅ Yes |
|
|
72
|
+
| Multilingual | ❌ No | ✅ 13+ languages |
|
|
73
|
+
|
|
74
|
+
mathparse uses [postfix (Reverse Polish) notation](https://mathparse.chatterbot.us/postfix/) internally, ensuring only valid mathematical operations are performed. See our [security documentation](https://mathparse.chatterbot.us/postfix/) for technical details.
|
|
75
|
+
|
|
76
|
+
## Performance
|
|
77
|
+
|
|
78
|
+
- **Fast**: Simple numeric expressions parse in microseconds
|
|
79
|
+
- **Efficient**: Minimal memory footprint, suitable for high-volume applications
|
|
80
|
+
- **Scalable**: Linear time complexity for expression evaluation
|
|
81
|
+
|
|
82
|
+
## Language Support
|
|
83
|
+
|
|
84
|
+
The language parameter must be set in order to evaluate an equation that uses word operators.
|
|
85
|
+
The language code should be a valid [ISO 639-2](https://www.loc.gov/standards/iso639-2/php/code_list.php) language code.
|
|
86
|
+
|
|
87
|
+
## Installation
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pip install mathparse
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Documentation
|
|
94
|
+
|
|
95
|
+
See the full documentation at https://mathparse.chatterbot.us
|
|
96
|
+
|
|
97
|
+
## Changelog
|
|
98
|
+
|
|
99
|
+
See [release notes](https://github.com/gunthercox/mathparse/releases) for changes.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: azrideus-mathparse
|
|
3
|
+
Version: 0.2.9
|
|
4
|
+
Summary: A fork of mathparse (https://github.com/gunthercox/mathparse) for my own usage; a library for solving mathematical equations contained in strings
|
|
5
|
+
Author: Gunther Cox
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Documentation, https://mathparse.chatterbot.us
|
|
8
|
+
Project-URL: Repository, https://github.com/gunthercox/mathparse
|
|
9
|
+
Project-URL: Changelog, https://github.com/gunthercox/mathparse/releases
|
|
10
|
+
Keywords: mathparse,mathematics,math,nlp,calculator,expression-parser,eval-alternative,safe-eval,multilingual,natural-language,postfix-notation,reverse-polish-notation,rpn,math-parser,expression-evaluator,secure-evaluation,language-processing,mathematical-expressions,formula-parser
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
16
|
+
Classifier: Topic :: Text Processing :: General
|
|
17
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
19
|
+
Requires-Python: <3.15,>=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: flake8; extra == "test"
|
|
24
|
+
Requires-Dist: sphinx<9.0,>=7.4; extra == "test"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# mathparse
|
|
28
|
+
|
|
29
|
+
**A secure, multilingual mathematical expression evaluator for Python**
|
|
30
|
+
|
|
31
|
+
`mathparse` is a Python library that safely parses and evaluates mathematical expressions from strings, supporting both numeric operators and natural language words across 13+ languages. Unlike Python's dangerous `eval()` function, mathparse provides a secure, zero-dependency solution for evaluating user-provided mathematical expressions.
|
|
32
|
+
|
|
33
|
+
## Why mathparse?
|
|
34
|
+
|
|
35
|
+
✅ **Security First** - Never uses `eval()`, protecting against arbitrary code execution
|
|
36
|
+
✅ **Multilingual Support** - Parse math in English, Spanish, French, German, Chinese, and 8+ more languages
|
|
37
|
+
✅ **Zero Dependencies** - Pure Python implementation with no external requirements
|
|
38
|
+
✅ **Natural Language** - Understands "fifty times twenty plus ten" alongside standard notation
|
|
39
|
+
✅ **Production Ready** - Used in chatbots, calculators, voice assistants, and educational applications
|
|
40
|
+
✅ **Well Tested** - Comprehensive test suite ensuring reliability
|
|
41
|
+
|
|
42
|
+
## Quick Examples
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from mathparse import mathparse
|
|
46
|
+
|
|
47
|
+
# Standard numeric expressions
|
|
48
|
+
mathparse.parse('50 * (85 / 100)')
|
|
49
|
+
>>> 42.5
|
|
50
|
+
|
|
51
|
+
# Natural language in English
|
|
52
|
+
mathparse.parse('one hundred times fifty four', language='ENG')
|
|
53
|
+
>>> 5400
|
|
54
|
+
|
|
55
|
+
# Mixed notation
|
|
56
|
+
mathparse.parse('(seven * nine) + 8 - (45 plus two)', language='ENG')
|
|
57
|
+
>>> 24
|
|
58
|
+
|
|
59
|
+
# Other languages (French, Spanish, German, Chinese, etc.)
|
|
60
|
+
mathparse.parse('cinq plus trois', language='FRE')
|
|
61
|
+
>>> 8
|
|
62
|
+
|
|
63
|
+
mathparse.parse('cinco más tres', language='ESP')
|
|
64
|
+
>>> 8
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Use Cases
|
|
68
|
+
|
|
69
|
+
- 🤖 **Chatbots & Voice Assistants** - Parse natural language math queries
|
|
70
|
+
- 🧮 **Calculator Applications** - Build safe calculators that accept text input
|
|
71
|
+
- 📚 **Educational Software** - Evaluate student-provided math expressions
|
|
72
|
+
- 🌐 **Multilingual Apps** - Support math parsing in users' native languages
|
|
73
|
+
- 🔐 **Secure Code Evaluation** - Replace dangerous `eval()` calls with safe parsing
|
|
74
|
+
- 📊 **Data Processing** - Extract and calculate values from natural language text
|
|
75
|
+
|
|
76
|
+
## Security: Why Not eval()?
|
|
77
|
+
|
|
78
|
+
Python's `eval()` function executes arbitrary code, creating severe security vulnerabilities:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
# DANGEROUS - Never do this with user input!
|
|
82
|
+
eval("__import__('os').system('rm -rf /')") # Deletes files
|
|
83
|
+
eval("__import__('requests').get('evil.com')") # Network access
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**mathparse is the safe alternative:**
|
|
87
|
+
|
|
88
|
+
| Feature | eval() | mathparse |
|
|
89
|
+
|---------|--------|-----------|
|
|
90
|
+
| Mathematical expressions | ✅ | ✅ |
|
|
91
|
+
| Arbitrary code execution | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
92
|
+
| File system access | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
93
|
+
| Network access | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
94
|
+
| Import statements | ⚠️ **YES - DANGEROUS** | ❌ No |
|
|
95
|
+
| Security risk | 🔴 **CRITICAL** | 🟢 Safe |
|
|
96
|
+
| Dependencies | 0 | 0 |
|
|
97
|
+
| Natural language support | ❌ No | ✅ Yes |
|
|
98
|
+
| Multilingual | ❌ No | ✅ 13+ languages |
|
|
99
|
+
|
|
100
|
+
mathparse uses [postfix (Reverse Polish) notation](https://mathparse.chatterbot.us/postfix/) internally, ensuring only valid mathematical operations are performed. See our [security documentation](https://mathparse.chatterbot.us/postfix/) for technical details.
|
|
101
|
+
|
|
102
|
+
## Performance
|
|
103
|
+
|
|
104
|
+
- **Fast**: Simple numeric expressions parse in microseconds
|
|
105
|
+
- **Efficient**: Minimal memory footprint, suitable for high-volume applications
|
|
106
|
+
- **Scalable**: Linear time complexity for expression evaluation
|
|
107
|
+
|
|
108
|
+
## Language Support
|
|
109
|
+
|
|
110
|
+
The language parameter must be set in order to evaluate an equation that uses word operators.
|
|
111
|
+
The language code should be a valid [ISO 639-2](https://www.loc.gov/standards/iso639-2/php/code_list.php) language code.
|
|
112
|
+
|
|
113
|
+
## Installation
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pip install mathparse
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Documentation
|
|
120
|
+
|
|
121
|
+
See the full documentation at https://mathparse.chatterbot.us
|
|
122
|
+
|
|
123
|
+
## Changelog
|
|
124
|
+
|
|
125
|
+
See [release notes](https://github.com/gunthercox/mathparse/releases) for changes.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
azrideus_mathparse.egg-info/PKG-INFO
|
|
5
|
+
azrideus_mathparse.egg-info/SOURCES.txt
|
|
6
|
+
azrideus_mathparse.egg-info/dependency_links.txt
|
|
7
|
+
azrideus_mathparse.egg-info/requires.txt
|
|
8
|
+
azrideus_mathparse.egg-info/top_level.txt
|
|
9
|
+
mathparse/__init__.py
|
|
10
|
+
mathparse/mathparse.py
|
|
11
|
+
mathparse/mathwords.py
|
|
12
|
+
tests/test_binary_operations.py
|
|
13
|
+
tests/test_complex_statements.py
|
|
14
|
+
tests/test_language_support.py
|
|
15
|
+
tests/test_prefix_unary_operations.py
|
|
16
|
+
tests/test_replace_word_tokens.py
|
|
17
|
+
tests/test_simplified_chinese.py
|
|
18
|
+
tests/test_unary_operations.py
|
|
19
|
+
tests/test_utils.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mathparse
|