magic-numbers
Magically import magic number constants. Like so:
from magic_numbers import FORTY_TWO, SIXTY_NINE, FOUR_HUNDRED_AND_TWENTY
from magic_numbers import ONE_THOUSAND_THREE_HUNDRED_AND_TWELVE
from magic_numbers import THREE_POINT_ONE_FOUR_ONE_FIVE_NINE_TWO as PI
print(f"{FORTY_TWO = }") # 42
print(f"{SIXTY_NINE = }") # 69
print(f"{FOUR_HUNDRED_AND_TWENTY = }") # 420
print(f"{ONE_THOUSAND_THREE_HUNDRED_AND_TWELVE = }") # 1312
print(f"{PI = }") # 3.141592
Note: Floats can only be specified using "point", there is no support (yet) for fractions like THREE_AND_A_HALF or TWO_THIRDS
Installation
python3 -m pip install magic-numbers
Metadata
Release files for magic-numbers 1.0.3
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_numbers-1.0.3.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| magic_numbers-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / magic_numbers-1.0.3.tar.gz
| Download URL | magic_numbers-1.0.3.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16680035652582500ab4d3abcaa908e6f48173bde0ef14b46822baad57c7bda5
|
|
BLAKE2b-256 checksum How to use checksums |
3e31deb47ce78eaae54accb8738b0e9936e3dca9aef8cc493fd027d4c2ae86a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / magic_numbers-1.0.3-py3-none-any.whl
| Download URL | magic_numbers-1.0.3-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97d731da16c485f3934290cfbdfd1a7820ffb387320d5cd1a7510bc9c084a26e
|
|
BLAKE2b-256 checksum How to use checksums |
2a43f5766a317d00a53710ac4d5ce2ba4e9c712204067ed54a508d3c742e3ca9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|