@staticmethod
def ghetto_encode(obj):
    """
            if everything else failed, try to encode the public obj attributes
            i.e. those attributes without a _ prefix
            :param obj: object to be encoded
            :return: encoded/serizlaized object
        """
    try:
        result = {}
        for k, v in vars(obj).items():
            if not k.startswith('_'):
                if isinstance(v, (int, float)) or v is None:
                    result[k] = v
                else:
                    result[k] = str(v)
    except TypeError:
        result = str(obj)
    return result
