mathparse
The mathparse library is a Python module designed to evaluate mathematical equations contained in strings.
Here are a few examples:
from mathparse import mathparse
mathparse.parse('50 * (85 / 100)')
>>> 42.5
mathparse.parse('one hundred times fifty four', mathparse.codes.ENG)
>>> 5400
mathparse.parse('(seven * nine) + 8 - (45 plus two)', language='ENG')
>>> 24
Installation
pip install mathparse
Language support
The language parameter must be set in order to evaluate an equation that uses word operators. The language code should be a valid ISO 639-2 language code.
History
See release notes for changes.
Metadata
Release files for mathparse 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mathparse-0.2.1.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mathparse-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.1 kB
Release files / mathparse-0.2.1.tar.gz
| Download URL | mathparse-0.2.1.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2986930feb7a7b926e05c15e3cf74ad41e7f209a0332aa6d6a7ec3fcb124fc2
|
|
BLAKE2b-256 checksum How to use checksums |
77d51cb88f30a0d69767173a59e6be0278c559cc9596375892b0e9540509a914
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / mathparse-0.2.1-py3-none-any.whl
| Download URL | mathparse-0.2.1-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f7bafe3cf91a88bd37e0ff4159b3a777c5ddba26d087d30f362a989c9d1af00
|
|
BLAKE2b-256 checksum How to use checksums |
d73f2fb7b17a7f76773a7bf4ee6b852171fd3178727eae8169cc93df3ab0505f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|