# Path: giraffez/fmt.py
# def safe_name(s):
#     return s.replace(" ", "_").lower()
# 
# Path: giraffez/logging.py
# def run_once(f):
#     def wrapper(*args, **kwargs):
# def setup_logging():
#     def colorize(cls, color, s):
#     def blue(cls, s):
#     def green(cls, s):
#     def gray(cls, s):
#     def white(cls, s):
#     def disabled(cls, s):
#     def bold(cls, s):
#     def fail(cls, s):
# def highlight(s):
#     def __init__(self, fd=None, level=INFO):
#     def level(self):
#     def level(self, v):
#     def _write(self, args, level=None, console=False):
#     def write(self, *args, **kwargs):
#     def info(self, *args, **kwargs):
#     def verbose(self, *args, **kwargs):
#     def debug(self, *args, **kwargs):
#     def fatal(self, msg=""):
#     def __init__(self, fd=None, level=INFO):
#     def _write(self, args, level=None, console=True):
# CONSOLE_HEADER = "\033[95m"
# CONSOLE_BLUE = "\033[94m"
# CONSOLE_GREEN = "\033[92m"
# CONSOLE_GRAY = "\033[37m"
# CONSOLE_WHITE = "\033[97m"
# CONSOLE_WARNING = "\033[93m"
# CONSOLE_ENDC = "\033[0m"
# CONSOLE_FAIL = "\033[91m"
# CONSOLE_BOLD = "\033[1m"
# CONSOLE_UNDERLINE = "\033[4m" 
# CONSOLE_DISABLED = "\033[38;5;240m" 
# class colors(object):
# class Logger(object):
# class LockingLogger(Logger):


import datetime
import math
import struct
from .constants import *
from .errors import *
from .fmt import safe_name
from .logging import log
from ._compat import *
    def safe_name(self):
        return safe_name(self.name)

    def __eq__(self, other):
        return str(self) == str(other)

    def __repr__(self):
        type_name = COL_TYPE_NAMES.get(self.type, "unknown")
        type_name = type_name.replace('_NN', '').replace('_N' , '').lower()
        if self.type in DECIMAL_TYPES :
            type_name = "{}[{}]({},{})".format(type_name, self.length, self.precision, self.scale)
        else:
            type_name = "{}({})".format(type_name, self.length)
        options = []
        if self._default:
            options.append(self._default)
        if self._nullable:
            options.append(self._nullable)
        if self._format:
            options.append(self._format)
        if options:
            type_name = "{} {}".format(type_name, " ".join(options))
        if self.original_name:
            name = self.original_name
        elif self.alias:
            name = self.alias
        elif self.title:
            name = self.title
        else:
            name = "n/a"

# Path: giraffez/fmt.py
# def safe_name(s):
#     return s.replace(" ", "_").lower()
# 
# Path: giraffez/logging.py
# def run_once(f):
#     def wrapper(*args, **kwargs):
# def setup_logging():
#     def colorize(cls, color, s):
#     def blue(cls, s):
#     def green(cls, s):
#     def gray(cls, s):
#     def white(cls, s):
#     def disabled(cls, s):
#     def bold(cls, s):
#     def fail(cls, s):
# def highlight(s):
#     def __init__(self, fd=None, level=INFO):
#     def level(self):
#     def level(self, v):
#     def _write(self, args, level=None, console=False):
#     def write(self, *args, **kwargs):
#     def info(self, *args, **kwargs):
#     def verbose(self, *args, **kwargs):
#     def debug(self, *args, **kwargs):
#     def fatal(self, msg=""):
#     def __init__(self, fd=None, level=INFO):
#     def _write(self, args, level=None, console=True):
# CONSOLE_HEADER = "\033[95m"
# CONSOLE_BLUE = "\033[94m"
# CONSOLE_GREEN = "\033[92m"
# CONSOLE_GRAY = "\033[37m"
# CONSOLE_WHITE = "\033[97m"
# CONSOLE_WARNING = "\033[93m"
# CONSOLE_ENDC = "\033[0m"
# CONSOLE_FAIL = "\033[91m"
# CONSOLE_BOLD = "\033[1m"
# CONSOLE_UNDERLINE = "\033[4m" 
# CONSOLE_DISABLED = "\033[38;5;240m" 
# class colors(object):
# class Logger(object):
# class LockingLogger(Logger):


# Path: giraffez/types.py
import datetime
import math
import struct
from .constants import *
from .errors import *
from .fmt import safe_name
from .logging import log
from ._compat import *

    def safe_name(self):
        return safe_name(self.name)

    def __eq__(self, other):
        return str(self) == str(other)

    def __repr__(self):
        type_name = COL_TYPE_NAMES.get(self.type, "unknown")
        type_name = type_name.replace('_NN', '').replace('_N' , '').lower()
        if self.type in DECIMAL_TYPES :
            type_name = "{}[{}]({},{})".format(type_name, self.length, self.precision, self.scale)
        else:
            type_name = "{}({})".format(type_name, self.length)
        options = []
        if self._default:
            options.append(self._default)
        if self._nullable:
            options.append(self._nullable)
        if self._format:
            options.append(self._format)
        if options:
            type_name = "{} {}".format(type_name, " ".join(options))
        if self.original_name:
            name = self.original_name
        elif self.alias:
            name = self.alias
        elif self.title:
            name = self.title
        else:
            name = "n/a"

        return "Column({} {})".format(safe_name(name), type_name)