def friendly_number(number):
    """
    Produce a human-readable value for file size.
    :param number: bytes.
    :return: human-readable string.
    """
    template = '%.1f%sB'
    powers = ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']
    base = 1000
    number = float(number)
    for power in powers[:-1]:
        if number < base:
            return template % (number, power)
        number /= base
    return template % (number, powers[-1])