magic-math
Magically import evaluated math expressions. Like so:
from magic_math import TEN_TIMES_FIVE_DIVIDED_BY_TWO
from magic_math import FIVE_TIMES_FIVE
from magic_math import TWO_HUNDRED_MINUS_TEN
from magic_math import SIX_HUNDRED_AND_SIXTY_SIX_DIVIDED_BY_TWO_TIMES_EIGHT
from magic_math import OPEN_FIVE_MINUS_THREE_CLOSE_TIMES_TEN
ABC=7
from magic_math import OPEN_TEN_MINUS_OPEN_ABC_DIVIDED_BY_TWO_CLOSE_CLOSE
print(f"{TEN_TIMES_FIVE_DIVIDED_BY_TWO = }") # 25.0
print(f"{FIVE_TIMES_FIVE = }") # 25.0
print(f"{TWO_HUNDRED_MINUS_TEN = }") # 190.0
print(f"{SIX_HUNDRED_AND_SIXTY_SIX_DIVIDED_BY_TWO_TIMES_EIGHT = }") # 2664.0
print(f"{OPEN_FIVE_MINUS_THREE_CLOSE_TIMES_TEN = }") # 20.0
print(f"{OPEN_TEN_MINUS_OPEN_ABC_DIVIDED_BY_TWO_CLOSE_CLOSE = }") # 6.5
Notes:
- All returned values are in floating point form
- Floats can be specified using "point" or "dot"
- Variables are partially supported, currently only within scripts
- Uses basic postfix order of precendence
- Basic parenteses syntax using
OPENandCLOSEvalues
Installation
python3 -m pip install magic-maths
Credits:
- Inspired by and uses code from David Buchanan's
magic-numberspackage
Metadata
Release files for magic-maths 0.1.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 | |
|---|---|---|---|
| magic_maths-0.1.1.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| magic_maths-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.4 kB
Release files / magic_maths-0.1.1.tar.gz
| Download URL | magic_maths-0.1.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
674c9e3d9dc23cb7bb9090a0086974e32dd96bd1287dbda351cbaeddcf0e4efb
|
|
BLAKE2b-256 checksum How to use checksums |
230d1d147c70cee1dcdddc249f83e79397d6d9dd6a8e25c02711b1a9ae821705
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.0
|
Release files / magic_maths-0.1.1-py3-none-any.whl
| Download URL | magic_maths-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f27f7c3365ae4600192cb7f615f3e06d076dea3a50dadcde85937f09e6de0b3
|
|
BLAKE2b-256 checksum How to use checksums |
a1910685eb158add51aa785df64b284eb3c6cc0dc747e3915e992f63b9ffc1e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.0
|