def lispify(value, string_to_keyword = False):
    """
    Converts a given value from a Python data type into its Lisp counterpart.

    Returns the following conversions:
        lists/arrays -> lists
        bools -> T or NIL
        ints -> ints
        floats -> floats
        strings -> strings (or chars if string len == 1) or keywords
        dicts -> acons lists (or NIL if key == "error")

    Parameter value: The value which needs to be converted (i.e. Lispified).
    Parameter string_to_keyword: Boolean to signal that strings should be
    converted into keywords.
    """
    if isinstance(value, list):
        return "(" + " ".join(["list"] + [lispify(v) for v in value]) + ")"
    elif isinstance(value, bool):
        return "T" if value else "NIL"
    elif isinstance(value, int) or isinstance(value, float):
        return str(value)
    elif isinstance(value, str):
        if len(value) == 1:
            return f"#\\{value}"
        else:
            return f":{value.lower()}" if string_to_keyword else f"\"{value}\""
    elif isinstance(value, dict):
        acons_list = []
        for k, v in value.items():
            if k == "error":
                return "NIL"
            acons_list += ["'({0} . {1})".format(lispify(k, True), lispify(v))]
        return "(" + " ".join(["list"] + acons_list) + ")"
    elif value is None:
        return "NIL"
    else:
        raise TypeError("lispify function does not know how to handle value of type: " + str(type(value)))