def class_to_dict(inst, ignore_list=[], attr_prefix=''):
    """ Writes state of class instance as a dict
        Includes both attributes and properties (i.e. those methods labeled with @property)
        Note: because this capture properties, it should be viewed as a snapshot of instance state
    :param inst:  instance to represent as dict
    :param ignore_list: list of attr
    :return: dict
    """
    output = vars(inst).copy()  # captures regular variables
    cls = type(inst)  # class of instance
    properties = [p for p in dir(cls) if isinstance(getattr(cls, p), property)]
    for p in properties:
        prop = getattr(cls, p)  # get property object by name
        output[p] = prop.fget(inst)  # call its fget
    for k in list(output.keys()):  # filter out dict keys mentioned in ignore-list
        if k in ignore_list:
            del output[k]
        else:  # prepend attr_prefix
            output[attr_prefix + k] = output.pop(k)

    output[attr_prefix + 'class'] = cls.__name__
    return output