Skip to main content

magically import magic number constants

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magic_numbers-1.0.3.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magic_numbers-1.0.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file magic_numbers-1.0.3.tar.gz.

File metadata

  • Download URL: magic_numbers-1.0.3.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for magic_numbers-1.0.3.tar.gz
Algorithm Hash digest
SHA256 16680035652582500ab4d3abcaa908e6f48173bde0ef14b46822baad57c7bda5
MD5 01db3afc6d9b66ca4e3d1f6b7e80e8a2
BLAKE2b-256 3e31deb47ce78eaae54accb8738b0e9936e3dca9aef8cc493fd027d4c2ae86a7

See more details on using hashes here.

File details

Details for the file magic_numbers-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: magic_numbers-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for magic_numbers-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 97d731da16c485f3934290cfbdfd1a7820ffb387320d5cd1a7510bc9c084a26e
MD5 c3ad401abba5e7e9906fc7f90304cea4
BLAKE2b-256 2a43f5766a317d00a53710ac4d5ce2ba4e9c712204067ed54a508d3c742e3ca9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page