def one_space(value):
    """"Removes empty spaces, tabs and new lines from a string and adds a space between words when necessary.

    Example:
        >>> from phanterpwa.tools import one_space
        >>> one_space("   My    long \r\n text. \tTabulation,      spaces,     spaces.         ")
        'My long text. Tabulation, spaces, spaces.'


    """
    result = ""
    if isinstance(value, str):
        value = value.strip()
        value = value.replace("\n", " ").replace("\t", " ").replace("\r", " ")
        spl = value.split(" ")
        result = " ".join([x for x in spl if x])
    return result