diff --git a/src/renatoxsr-py/const.py b/src/renatoxsr-py/const.py new file mode 100644 index 0000000..f061fec --- /dev/null +++ b/src/renatoxsr-py/const.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +# vim: set ft=python ts=4 sw=4 et: fileencoding=utf-8 +# SPDX-FileCopyrightText: 2025-present RenatoXSR +# SPDX-License-Identifier: BSD-3-Clause-Clear +"""CONSTANTS""" + +# Builtin imports +from datetime import datetime, date, time +from enum import Enum, StrEnum +from pathlib import Path + +import pandas as pd +import numpy as np + +class COLORS(StrEnum): + # see: https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences + RESET = "\033[0m" + RED = "\033[31m" + BLUE = "\033[34m" + GREY = "\033[90m" + WHITE = "\033[37m" + GREEN = "\033[32m" + YELLOW = "\033[93m" + ORANGE = "\033[33m" + CYAN = "\033[36m" + DEFAULT = WHITE + TITLE = WHITE + ERROR = RED + DEBUG = CYAN + WARNING = ORANGE + WARN = YELLOW + INFO = GREEN + CRITICAL = WHITE + + + @classmethod + def _missing_(cls, value): + #value = value.lower() + for member in cls: + if member.value == value: + return member + return cls.DEFAULT + + +class INVALID (Enum): + EMPTY = object() + INT = object() + NONE = None + NAN = np.nan + NAT = pd.NaT + DF = pd.DataFrame().to_string() + SERIES = pd.Series().to_string() + STR = str() + LIST = list() + DICT = dict() + TUPLE = tuple() + SET = set() + ERROR = Exception + DATE = date(1900,1,1) + +# EOF \ No newline at end of file