def bytes_to_human(size, decimal_places=2):
    """ Returns a human readable file size from a number of bytes. """
    for unit in ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']:
        if size < 1024:
            break
        size /= 1024
    return f'{size:.{decimal_places}f}{unit}B'
