def human_readable_filesize(size):
    """Convert file size in bytes to human readable format

    Args:
        size (int): Size in bytes

    Returns:
        str: Human readable file-size, i.e. 567.4 KB (580984 bytes)

    """
    if size < 1024:
        return "{} bytes".format(size)
    remain = float(size)
    for unit in ["B", "KB", "MB", "GB", "TB"]:
        if remain < 1024.0:
            return "{:.1f} {} ({:d} bytes)".format(remain, unit, size)
        remain /= 1024.0