Skip to main content

Codetable is a lightweight package for seamlessly setting up codes, such as those used in API responses.

Project description

from codetable import Code, Codes, msg


class UserErrorCodes(Codes):
    NAMESPACE: str = "user"

    ALREADY_EXISTS: str
    DOES_NOT_EXIST: Code = msg("User does not exist.")


print("# ALREADY_EXISTS\n")
print("code:", UserErrorCodes.ALREADY_EXISTS)

print("\n# DOES_NOT_EXIST\n")
print("obj:", UserErrorCodes.DOES_NOT_EXIST)
print("code:", UserErrorCodes.DOES_NOT_EXIST.code)
print("msg:", UserErrorCodes.DOES_NOT_EXIST.msg)

# # ALREADY_EXISTS

# code: user_already_exists

# # DOES_NOT_EXIST

# obj: Code(code='user_does_not_exist', msg='User does not exist.')
# code: user_does_not_exist
# msg: User does not exist.

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

codetable-1.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

codetable-1.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file codetable-1.0.1.tar.gz.

File metadata

  • Download URL: codetable-1.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for codetable-1.0.1.tar.gz
Algorithm Hash digest
SHA256 211223d59da1bcf0d7b19f1cc04605c81c5f8657931b892b321b2cef4e26b4a6
MD5 29633987d16178dc266308ce229f45b2
BLAKE2b-256 29b2223914cb953c65a08112a02525ab1138dc5a3b6f2f7f0de78e7f29ad64b2

See more details on using hashes here.

File details

Details for the file codetable-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: codetable-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for codetable-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 781501bad7e914c1da6a0ca88bc111ca8fe1ff7731d7fa1bd51e756b7272680e
MD5 c807d05a52f3d5cd365337c3fd9b4e39
BLAKE2b-256 c91dfd23991997be80ea42878a6ba79233cf48f6f712e4a4384472cb5d9f7e31

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