def _str_len_check(text, min_len, max_len):
    """
    Validate string type, max and min length.
    """
    if not isinstance(text, str):
        raise ValueError("expected string type")
    if not (min_len <= len(text) <= max_len):
        raise ValueError(f"length should be between {min_len} and {max_len} characters")
    return text