mathparse 0.2.1__tar.gz → 0.2.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.
- {mathparse-0.2.1 → mathparse-0.2.3}/PKG-INFO +17 -7
- mathparse-0.2.3/README.md +43 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/mathparse/__init__.py +1 -1
- mathparse-0.2.3/mathparse/mathparse.py +719 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/mathparse/mathwords.py +380 -18
- {mathparse-0.2.1 → mathparse-0.2.3}/mathparse.egg-info/PKG-INFO +17 -7
- {mathparse-0.2.1 → mathparse-0.2.3}/mathparse.egg-info/SOURCES.txt +3 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/tests/test_binary_operations.py +23 -0
- mathparse-0.2.3/tests/test_complex_statements.py +66 -0
- mathparse-0.2.3/tests/test_language_support.py +34 -0
- mathparse-0.2.3/tests/test_replace_word_tokens.py +65 -0
- mathparse-0.2.3/tests/test_simplified_chinese.py +167 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/tests/test_unary_operations.py +5 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/tests/test_utils.py +5 -0
- mathparse-0.2.1/README.md +0 -33
- mathparse-0.2.1/mathparse/mathparse.py +0 -319
- mathparse-0.2.1/tests/test_replace_word_tokens.py +0 -33
- {mathparse-0.2.1 → mathparse-0.2.3}/LICENSE +0 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/mathparse.egg-info/dependency_links.txt +0 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/mathparse.egg-info/requires.txt +0 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/mathparse.egg-info/top_level.txt +0 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/pyproject.toml +0 -0
- {mathparse-0.2.1 → mathparse-0.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mathparse
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: mathparse is a library for solving mathematical equations contained in strings
|
|
5
5
|
Author: Gunther Cox
|
|
6
6
|
License-Expression: MIT
|
|
@@ -36,24 +36,34 @@ from mathparse import mathparse
|
|
|
36
36
|
mathparse.parse('50 * (85 / 100)')
|
|
37
37
|
>>> 42.5
|
|
38
38
|
|
|
39
|
-
mathparse.parse('one hundred times fifty four',
|
|
39
|
+
mathparse.parse('one hundred times fifty four', language='ENG')
|
|
40
40
|
>>> 5400
|
|
41
41
|
|
|
42
42
|
mathparse.parse('(seven * nine) + 8 - (45 plus two)', language='ENG')
|
|
43
43
|
>>> 24
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
## Security
|
|
47
|
+
|
|
48
|
+
Mathparse does not employ the use of Python's [`eval` function](https://docs.python.org/3/library/functions.html#eval) when evaluating provided mathematical expressions. This is a measure to prevent arbitrary code execution vulnerabilities. See https://mathparse.chatterbot.us/postfix/ for additional details.
|
|
49
|
+
|
|
50
|
+
Mathparse is a standalone Python package and requires zero dependencies to function.
|
|
51
|
+
|
|
52
|
+
## Language Support
|
|
53
|
+
|
|
54
|
+
The language parameter must be set in order to evaluate an equation that uses word operators.
|
|
55
|
+
The language code should be a valid [ISO 639-2](https://www.loc.gov/standards/iso639-2/php/code_list.php) language code.
|
|
56
|
+
|
|
46
57
|
## Installation
|
|
47
58
|
|
|
48
59
|
```bash
|
|
49
60
|
pip install mathparse
|
|
50
61
|
```
|
|
51
62
|
|
|
52
|
-
##
|
|
63
|
+
## Documentation
|
|
53
64
|
|
|
54
|
-
|
|
55
|
-
The language code should be a valid [ISO 639-2](https://www.loc.gov/standards/iso639-2/php/code_list.php) language code.
|
|
65
|
+
See the full documentation at https://mathparse.chatterbot.us
|
|
56
66
|
|
|
57
|
-
##
|
|
67
|
+
## Changelog
|
|
58
68
|
|
|
59
|
-
See [release notes](https://github.com/gunthercox/
|
|
69
|
+
See [release notes](https://github.com/gunthercox/mathparse/releases) for changes.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# mathparse
|
|
2
|
+
|
|
3
|
+
The `mathparse` library is a Python module designed to evaluate mathematical equations contained in strings.
|
|
4
|
+
|
|
5
|
+
Here are a few examples:
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from mathparse import mathparse
|
|
9
|
+
|
|
10
|
+
mathparse.parse('50 * (85 / 100)')
|
|
11
|
+
>>> 42.5
|
|
12
|
+
|
|
13
|
+
mathparse.parse('one hundred times fifty four', language='ENG')
|
|
14
|
+
>>> 5400
|
|
15
|
+
|
|
16
|
+
mathparse.parse('(seven * nine) + 8 - (45 plus two)', language='ENG')
|
|
17
|
+
>>> 24
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Security
|
|
21
|
+
|
|
22
|
+
Mathparse does not employ the use of Python's [`eval` function](https://docs.python.org/3/library/functions.html#eval) when evaluating provided mathematical expressions. This is a measure to prevent arbitrary code execution vulnerabilities. See https://mathparse.chatterbot.us/postfix/ for additional details.
|
|
23
|
+
|
|
24
|
+
Mathparse is a standalone Python package and requires zero dependencies to function.
|
|
25
|
+
|
|
26
|
+
## Language Support
|
|
27
|
+
|
|
28
|
+
The language parameter must be set in order to evaluate an equation that uses word operators.
|
|
29
|
+
The language code should be a valid [ISO 639-2](https://www.loc.gov/standards/iso639-2/php/code_list.php) language code.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install mathparse
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
See the full documentation at https://mathparse.chatterbot.us
|
|
40
|
+
|
|
41
|
+
## Changelog
|
|
42
|
+
|
|
43
|
+
See [release notes](https://github.com/gunthercox/mathparse/releases) for changes.
|