import string
import random


def random_str(number=None, lower=False, upper=False, title=False):
    """随机不重复字符串

    Args:
      number: int: 字符串长度 (Default value = None)
      lower: bool: 是否全小写 (Default value = False)
      upper: bool: 是否全大写 (Default value = False)
      title: bool: 是否首字母大写 (Default value = False)

    Returns:
      : str类型的多位字符

    """
    if number is None:
        number = random.randint(5, 10)
    str_ = "".join(random.sample(string.ascii_letters, number))
    if lower:
        return str_.lower()
    elif upper:
        return str_.upper()
    elif title:
        return str_.title()
    else:
        return str_