class_docstr: A class for handling connections and interactions with the Google Books API.
class_docstr_tok: ["A","class","for","handling","connections","and","interactions","with","the","Google","Books","API","."]
docstr: Get bookshelf from Google Books API
  Args:
      params (dict): query parameters
  Returns:
      DataFrame
docstr_tok: ["Get","bookshelf","from","Google","Books","API","Args",":","params","(","dict",")",":","query","parameters","Returns",":","DataFrame"]
code: def get_bookshelves(self, params: dict = None) -> DataFrame:
      """
      Get bookshelf from Google Books API
      Args:
          params (dict): query parameters
      Returns:
          DataFrame
      """
      service = self.connect()
      minShelf = None
      maxShelf = None
      if params["shelf"]:
          shelf = int(params["shelf"])
          if params["source"]:
              df = (
                  service.mylibrary()
                  .bookshelves()
                  .get(
                      shelf=shelf,
                      userid=params["userid"],
                      source=params["source"],
                  )
                  .execute()
              )
          else:
              df = (
                  service.mylibrary()
                  .bookshelves()
                  .get(shelf=shelf, userid=params["userid"])
                  .execute()
              )
  
          df = pd.DataFrame(df, columns=self.bookshelves.get_columns())
          return df
      elif not params["minShelf"] and params["maxShelf"]:
          minShelf = int(params["maxShelf"]) - 10
          maxShelf = int(params["maxShelf"])
      elif not params["maxShelf"] and params["minShelf"]:
          minShelf = int(params["minShelf"])
          maxShelf = int(params["minShelf"]) + 10
      elif params["maxShelf"] and params["minShelf"]:
          minShelf = int(params["minShelf"])
          maxShelf = int(params["maxShelf"])
  
      args = {
          key: value
          for key, value in params.items()
          if key not in ["minShelf", "maxShelf"] and value is not None
      }
      bookshelves = (
          service.bookshelves()
          .list(userid=params["userid"], **args)
          .execute()
      )
  
      df = pd.DataFrame(
          bookshelves["items"], columns=self.bookshelves.get_columns()
      )
      if minShelf is not None or maxShelf is not None:
          # Drop bookshelves that are not in the id range
          df = df.drop(
              df[(df["id"] < minShelf) | (df["id"] > maxShelf)].index
          )
  
      return df
  
imports: import os
  from google.auth.transport.requests import Request
  from google.oauth2 import service_account
  from google.oauth2.credentials import Credentials
  from googleapiclient.discovery import build
  import pandas
  from pandas import DataFrame
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from .google_books_tables import BookshelvesTable, VolumesTable
  from mindsdb.integrations.libs.api_handler import APIHandler, FuncParser
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse
  from mindsdb.utilities import log
label_desc: Use image node_id 5 for calling the GoogleBooksHandler obj's underlying member method code with example usage: obj.get_bookshelves(params) and returns: df, df