human_math
A mathematical expression parser
Example usage
>>> import human_math as hm # import module
>>> tree = hm.parse("2 - (-sin(3pi/2)) - 3.0") # parse string (user input, etc.)
>>> tree
((2 - (-1 * sin(3 * (pi / 2)))) - 3) # console representation uses parentheses everywhere to be strictly non-ambigious
>>> tree.evaluate() # evaluate the expression tree
-2 # nb: sin(3pi/2) = -1 so 2 - (-1) - 3 = -2
Metadata
Release files for human_math 0.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 | |
|---|---|---|---|
| human_math-0.1.tar.gz | 12.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| human_math-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.3 kB
Release files / human_math-0.1.tar.gz
| Download URL | human_math-0.1.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f84342c5ca2890e11b1c1e2d8f1d1776ff5e6e853289416c2ce48ddebfb638b1
|
|
BLAKE2b-256 checksum How to use checksums |
1eaf868ed4aecdf0150a2667bc0d5db82685a2d0671831d7475d20ad037c3a94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / human_math-0.1-py3-none-any.whl
| Download URL | human_math-0.1-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c69cbf7d5843adf5afcaf323ee40c3a50ded609f0089a9fdace5059450f2c8a4
|
|
BLAKE2b-256 checksum How to use checksums |
a5c64728260d9e422ede7a5af4a740dc9fe0eff6712c1fbe6a3846c0be73c62d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|