def textFileToDict (fileName, kType="s", vType="s", delimiter=":"):
    """Reads fileName and converts its data into a dict.

    Correct line data format: "KEY[delimiter]VALUE".

    :param str fileName:
        The text file to pull data from.
    :param str kType:
        The target data type of keys assigned to the dict: "s" for str;
        "i" for int; "f" for float.
    :param str vType:
        The target data type of values assigned to the dict: "s" for
        str; "i" for int; "f" for float.
    :param str delimiter:
        The character separating key data from value data.
    :return:
        A dictionary containing desired data.
    :rtype: dict or None
    :except ValueError:
        Will return None if data is formatted incorrectly or data is
        incapable of being converted to target kType/vType.
    """
    dictionary = {}
    validTypes = {"s": str, "i": int, "f": float}

    if (
        kType not in validTypes or
        vType not in validTypes
    ):
        return None

    kType = validTypes[kType]
    vType = validTypes[vType]

    with open(fileName) as f:
        for line in f:
            # strips "\n"
            line = line.strip()
            try:
                key, value = line.split(delimiter)
            except ValueError:
                return None

            try:
                if kType == int:
                    key = float(key)
                    key = kType(key)
                else:
                    key = kType(key)

                if vType == int:
                    value = float(value)
                    value = vType(value)
                else:
                    value = vType(value)
            except ValueError:
                return None

            dictionary[key] = value

    return dictionary