import csv


def build_books_list(search_file):
  """
  Get a list of books from the specify file

  Parameters:
    search_file: The file to search in.
  Returns:
    books_list: The list of books
  """

  with open(search_file, newline = '') as csvfile:
    reader = csv.reader(csvfile, delimiter= ',')
    books_list = []
    for row in reader:
      book = {}
      book["title"] = row[0]

      authors_with_years = row[2].split(" (")
      book["author"] = [authors_with_years[0]]
      if len(authors_with_years) > 2:
        '''There are some books that have 2 authors'''
        second_author = authors_with_years[1].split(' and ')[1]
        book["author"].append(second_author)

      book["published_year"] = int(row[1])

      books_list.append(book)
    return books_list