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
Release history Release notifications | RSS feed
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.2.tar.gz
(3.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codetable-1.0.2.tar.gz.
File metadata
- Download URL: codetable-1.0.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a02b012926ba0f8108bea0468ffd913982e5986455cc6a636a50c4b5f833868d
|
|
| MD5 |
2012e99791be4c47fc683bd1fcf8b942
|
|
| BLAKE2b-256 |
cc14e81a251066e1a7704af2c7825ae7a33f737f432633d614ae2614b4318293
|
File details
Details for the file codetable-1.0.2-py3-none-any.whl.
File metadata
- Download URL: codetable-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3e6623281738c3a37be2b36e9bb1ce705d692c39915b015fd1e330a305e1edf
|
|
| MD5 |
d7f69eccb2a1ab7a717b38efa15b33a1
|
|
| BLAKE2b-256 |
58c02a0ead7337a3178dca33b1ab8f2ac10d1d2e8f03cc09cca0efe1e0251156
|