gspread の API リファレンス
gspread (burnash/gspread) の公開 API 145 件 —— クラス 11、関数 21、メソッド 113。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。
リポジトリ: burnash/gspread
| 種別 | 件数 |
|---|---|
| クラス | 11 |
| 関数 | 21 |
| メソッド | 113 |
API 一覧
class
gspread.auth.FlowCallableProtocol for OAuth flow callables.
func
gspread.auth.api_key(token:str, http_client:HTTPClientType=HTTPClient) -> ClientAuthenticate using an API key.
func
gspread.auth.authorize(credentials:Credentials, http_client:HTTPClientType=HTTPClient, session:Optional[Session]=None) -> ClientLogin to Google API using OAuth2 credentials.
func
gspread.auth.get_config_dir(config_dir_name:str='gspread', os_is_windows:bool=os.name == 'nt') -> PathConstruct a config dir path.
func
gspread.auth.local_server_flow(client_config:Mapping[str, Any], scopes:Iterable[str], port:int=0) -> OAuthCredentialsRun an OAuth flow using a local server strategy.
func
gspread.auth.service_account(filename:Union[Path, str]=DEFAULT_SERVICE_ACCOUNT_FILENAME, scopes:Iterable[str]=DEFAULT_SCOPES, http_client:HTTPClientType=HTTPClient) -> ClientAuthenticate using a service account.
func
gspread.auth.service_account_from_dict(info:Mapping[str, Any], scopes:Iterable[str]=DEFAULT_SCOPES, http_client:HTTPClientType=HTTPClient) -> ClientAuthenticate using a service account (json).
method
gspread.cell.Cell.address() -> strCell address in A1 notation.
method
gspread.cell.Cell.col() -> intColumn number of the cell.
method
gspread.cell.Cell.numeric_value() -> Optional[Union[int, float]]Numeric value of this cell.
method
gspread.cell.Cell.row() -> intRow number of the cell.
method
gspread.client.Client.copy(file_id:str, title:Optional[str]=None, copy_permissions:bool=False, folder_id:Optional[str]=None, copy_comments:bool=True) -> SpreadsheetCopies a spreadsheet.
method
gspread.client.Client.create(title:str, folder_id:Optional[str]=None) -> SpreadsheetCreates a new spreadsheet.
method
gspread.client.Client.del_spreadsheet(file_id:str) -> NoneDeletes a spreadsheet.
method
gspread.client.Client.export(file_id:str, format:str=ExportFormat.PDF) -> bytesExport the spreadsheet in the given format.
method
gspread.client.Client.import_csv(file_id:str, data:Union[str, bytes]) -> AnyImports data into the first page of the spreadsheet.
method
gspread.client.Client.insert_permission(file_id:str, value:Optional[str]=None, perm_type:Optional[str]=None, role:Optional[str]=None, notify:bool=True, email_message:Optional[str]=None, with_link:bool=False) -> ResponseCreates a new permission for a file.
method
gspread.client.Client.list_permissions(file_id:str) -> List[Dict[str, Union[str, bool]]]Retrieve a list of permissions for a file.
method
gspread.client.Client.open(title:str, folder_id:Optional[str]=None) -> SpreadsheetOpens a spreadsheet.
method
gspread.client.Client.open_by_key(key:str) -> SpreadsheetOpens a spreadsheet specified by `key` (a.k.a Spreadsheet ID).
method
gspread.client.Client.open_by_url(url:str) -> SpreadsheetOpens a spreadsheet specified by `url`.
method
gspread.client.Client.openall(title:Optional[str]=None) -> List[Spreadsheet]Opens all available spreadsheets.
method
gspread.client.Client.remove_permission(file_id:str, permission_id:str) -> NoneDeletes a permission from a file.
class
gspread.exceptions.GSpreadExceptionA base class for gspread's exceptions.
class
gspread.exceptions.IncorrectCellLabelThe cell label is incorrect.
class
gspread.exceptions.InvalidInputValueThe provided values is incorrect.
class
gspread.exceptions.NoValidUrlKeyFoundNo valid key found in URL.
class
gspread.exceptions.SpreadsheetNotFoundTrying to open non-existent or inaccessible spreadsheet.
class
gspread.exceptions.UnSupportedExportFormatRaised when export format is not supported.
class
gspread.exceptions.WorksheetNotFoundTrying to open non-existent or inaccessible worksheet.
class
gspread.http_client.HTTPClientAn instance of this class communicates with Google API.
method
gspread.http_client.HTTPClient.export(file_id:str, format:str=ExportFormat.PDF) -> bytesExport the spreadsheet in the given format.
method
gspread.http_client.HTTPClient.import_csv(file_id:str, data:Union[str, bytes]) -> AnyImports data into the first page of the spreadsheet.
method
gspread.http_client.HTTPClient.list_permissions(file_id:str) -> List[Dict[str, Union[str, bool]]]Retrieve a list of permissions for a file.
method
gspread.http_client.HTTPClient.remove_permission(file_id:str, permission_id:str) -> NoneDeletes a permission from a file.
class
gspread.spreadsheet.SpreadsheetThe class that represents a spreadsheet.
method
gspread.spreadsheet.Spreadsheet.accept_ownership(permission_id:str) -> ResponseAccept the pending ownership request on that file.
method
gspread.spreadsheet.Spreadsheet.add_worksheet(title:str, rows:int, cols:int, index:Optional[int]=None) -> WorksheetAdds a new worksheet to a spreadsheet.
method
gspread.spreadsheet.Spreadsheet.creationTime() -> strSpreadsheet Creation time.
method
gspread.spreadsheet.Spreadsheet.del_worksheet(worksheet:Worksheet) -> AnyDeletes a worksheet from a spreadsheet.
method
gspread.spreadsheet.Spreadsheet.del_worksheet_by_id(worksheet_id:Union[str, int]) -> AnyDeletes a Worksheet by id
method
gspread.spreadsheet.Spreadsheet.duplicate_sheet(source_sheet_id:int, insert_sheet_index:Optional[int]=None, new_sheet_id:Optional[int]=None, new_sheet_name:Optional[str]=None) -> WorksheetDuplicates the contents of a sheet.
method
gspread.spreadsheet.Spreadsheet.export(format:ExportFormat=ExportFormat.PDF) -> bytesExport the spreadsheet in the given format.
method
gspread.spreadsheet.Spreadsheet.get_lastUpdateTime() -> strGet the lastUpdateTime metadata from the Drive API.
method
gspread.spreadsheet.Spreadsheet.get_worksheet(index:int) -> WorksheetReturns a worksheet with specified `index`.
method
gspread.spreadsheet.Spreadsheet.get_worksheet_by_id(id:Union[str, int]) -> WorksheetReturns a worksheet with specified `worksheet id`.
method
gspread.spreadsheet.Spreadsheet.id() -> strSpreadsheet ID.
method
gspread.spreadsheet.Spreadsheet.lastUpdateTime() -> strSpreadsheet last updated time.
method
gspread.spreadsheet.Spreadsheet.list_named_ranges() -> List[Any]Lists the spreadsheet's named ranges.
method
gspread.spreadsheet.Spreadsheet.list_permissions() -> List[Dict[str, Union[str, bool]]]Lists the spreadsheet's permissions.
method
gspread.spreadsheet.Spreadsheet.list_protected_ranges(sheetid:int) -> List[Any]Lists the spreadsheet's protected named ranges
method
gspread.spreadsheet.Spreadsheet.locale() -> strSpreadsheet locale
method
gspread.spreadsheet.Spreadsheet.remove_permissions(value:str, role:str='any') -> List[str]Remove permissions from a user or domain.
method
gspread.spreadsheet.Spreadsheet.share(email_address:str, perm_type:str, role:str, notify:bool=True, email_message:Optional[str]=None, with_link:bool=False) -> ResponseShare the spreadsheet with other accounts.
method
gspread.spreadsheet.Spreadsheet.sheet1() -> WorksheetShortcut property for getting the first worksheet.
method
gspread.spreadsheet.Spreadsheet.timezone() -> strSpreadsheet timeZone
method
gspread.spreadsheet.Spreadsheet.title() -> strSpreadsheet title.
method
gspread.spreadsheet.Spreadsheet.transfer_ownership(permission_id:str) -> ResponseTransfer the ownership of this file to a new user.
method
gspread.spreadsheet.Spreadsheet.update_locale(locale:str) -> AnyUpdate the locale of the spreadsheet.
method
gspread.spreadsheet.Spreadsheet.update_timezone(timezone:str) -> AnyUpdates the current spreadsheet timezone.
method
gspread.spreadsheet.Spreadsheet.update_title(title:str) -> AnyRenames the spreadsheet.
method
gspread.spreadsheet.Spreadsheet.url() -> strSpreadsheet URL.
method
gspread.spreadsheet.Spreadsheet.worksheet(title:str) -> WorksheetReturns a worksheet with specified `title`.
func
gspread.utils.a1_range_to_grid_range(name:str, sheet_id:Optional[int]=None) -> Dict[str, int]Converts a range defined in A1 notation to a dict representing a `GridRange`_.
func
gspread.utils.a1_to_rowcol(label:str) -> Tuple[int, int]Translates a cell's address in A1 notation to a tuple of integers.
func
gspread.utils.absolute_range_name(sheet_name:str, range_name:Optional[str]=None) -> strReturn an absolutized path of a range.
func
gspread.utils.column_letter_to_index(column:str) -> intConverts a column letter to its numerical index.
func
gspread.utils.convert_colors_to_hex_value(red:float=0.0, green:float=0.0, blue:float=0.0) -> strConvert RGB color values to a hex color code.
func
gspread.utils.convert_hex_to_colors_dict(hex_color:str) -> Mapping[str, float]Convert a hex color code to RGB color values.
func
gspread.utils.extract_title_from_range(range_string:str) -> strExtracts the worksheet title from a range string.
func
gspread.utils.fill_gaps(L:List[List[Any]], rows:Optional[int]=None, cols:Optional[int]=None, padding_value:Any='') -> List[List[Any]]Fill gaps in a list of lists.
func
gspread.utils.finditem(func:Callable[[T], bool], seq:Iterable[T]) -> TFinds and returns first item in iterable for which func(item) is True.
func
gspread.utils.get_a1_from_absolute_range(range_name:str) -> strGet the A1 notation from an absolute range name.
func
gspread.utils.is_full_a1_notation(range_name:str) -> boolCheck if the range name is a full A1 notation.
func
gspread.utils.is_scalar(x:Any) -> boolReturn True if the value is scalar.
func
gspread.utils.rowcol_to_a1(row:int, col:int) -> strTranslates a row and column cell address to A1 notation.
func
gspread.utils.to_hex(value:float) -> strConvert an integer to a 2-digit uppercase hex string.
func
gspread.utils.wid_to_gid(wid:str) -> strCalculate gid of a worksheet from its wid.
class
gspread.worksheet.ValueRangeThe class holds the returned values.
method
gspread.worksheet.ValueRange.first(default:Optional[str]=None) -> Optional[str]Returns the value of a first cell in a range.
method
gspread.worksheet.ValueRange.range() -> strThe range of the values
method
gspread.worksheet.Worksheet.acell(label:str, value_render_option:ValueRenderOption=ValueRenderOption.formatted) -> CellReturns an instance of a :class:`gspread.cell.Cell`.
method
gspread.worksheet.Worksheet.add_cols(cols:int) -> NoneAdds columns to worksheet.
method
gspread.worksheet.Worksheet.add_dimension_group_columns(start:int, end:int) -> JSONResponseGroup columns in order to hide them in the UI.
method
gspread.worksheet.Worksheet.add_dimension_group_rows(start:int, end:int) -> JSONResponseGroup rows in order to hide them in the UI.
method
gspread.worksheet.Worksheet.add_rows(rows:int) -> NoneAdds rows to worksheet.
method
gspread.worksheet.Worksheet.batch_clear(ranges:Sequence[str]) -> JSONResponseClears multiple ranges of cells with 1 API call.
method
gspread.worksheet.Worksheet.batch_format(formats:List[CellFormat]) -> JSONResponseFormats cells in batch.
method
gspread.worksheet.Worksheet.batch_merge(merges:List[Dict[Literal['range', 'mergeType'], Union[str, MergeType]]], merge_type:MergeType=MergeType.merge_all) -> AnyMerge multiple ranges at the same time.
method
gspread.worksheet.Worksheet.clear() -> JSONResponseClears all cells in the worksheet.
method
gspread.worksheet.Worksheet.clear_basic_filter() -> JSONResponseRemove the basic filter from a worksheet.
method
gspread.worksheet.Worksheet.clear_note(cell:str) -> NoneClear a note.
method
gspread.worksheet.Worksheet.clear_tab_color() -> JSONResponseClears the worksheet's tab color.
method
gspread.worksheet.Worksheet.col_count() -> intNumber of columns.
method
gspread.worksheet.Worksheet.column_count() -> intNumber of columns
method
gspread.worksheet.Worksheet.columns_auto_resize(start_column_index:int, end_column_index:int) -> JSONResponseUpdates the size of rows or columns in the worksheet.
method
gspread.worksheet.Worksheet.copy_to(destination_spreadsheet_id:str) -> JSONResponseCopies this sheet to another spreadsheet.
method
gspread.worksheet.Worksheet.cut_range(source:str, dest:str, paste_type:PasteType=PasteType.normal) -> JSONResponseMoves a range of data form source to dest ..
method
gspread.worksheet.Worksheet.delete_dimension_group_columns(start:int, end:int) -> JSONResponseRemove the grouping of a set of columns.
method
gspread.worksheet.Worksheet.delete_dimension_group_rows(start:int, end:int) -> JSONResponseRemove the grouping of a set of rows.
method
gspread.worksheet.Worksheet.delete_protected_range(id:str) -> JSONResponseDelete protected range identified by the ID ``id``.
method
gspread.worksheet.Worksheet.duplicate(insert_sheet_index:Optional[int]=None, new_sheet_id:Optional[int]=None, new_sheet_name:Optional[str]=None) -> 'Worksheet'Duplicate the sheet.
method
gspread.worksheet.Worksheet.find(query:Union[str, re.Pattern], in_row:Optional[int]=None, in_column:Optional[int]=None, case_sensitive:bool=True) -> Optional[Cell]Finds the first cell matching the query.
method
gspread.worksheet.Worksheet.findall(query:Union[str, re.Pattern], in_row:Optional[int]=None, in_column:Optional[int]=None, case_sensitive:bool=True) -> List[Cell]Finds all cells matching the query.
method
gspread.worksheet.Worksheet.format(ranges:Union[List[str], str], format:JSONResponse) -> JSONResponseFormat a list of ranges with the given format.
method
gspread.worksheet.Worksheet.freeze(rows:Optional[int]=None, cols:Optional[int]=None) -> JSONResponseFreeze rows and/or columns on the worksheet.
method
gspread.worksheet.Worksheet.frozen_col_count() -> intNumber of frozen columns.
method
gspread.worksheet.Worksheet.frozen_row_count() -> intNumber of frozen rows.
method
gspread.worksheet.Worksheet.get_all_cells() -> List[Cell]Returns a list of all `Cell` of the current sheet.
method
gspread.worksheet.Worksheet.get_tab_color() -> Optional[str]Tab color style in hex format.
method
gspread.worksheet.Worksheet.hide() -> JSONResponseHides the current worksheet from the UI.
method
gspread.worksheet.Worksheet.hide_columns(start:int, end:int) -> JSONResponseExplicitly hide the given column index range.
method
gspread.worksheet.Worksheet.hide_gridlines() -> JSONResponseHide gridlines on the current worksheet
method
gspread.worksheet.Worksheet.hide_rows(start:int, end:int) -> JSONResponseExplicitly hide the given row index range.
method
gspread.worksheet.Worksheet.id() -> intWorksheet ID.
method
gspread.worksheet.Worksheet.index() -> intWorksheet index.
method
gspread.worksheet.Worksheet.insert_note(cell:str, content:str) -> NoneInsert a note.
method
gspread.worksheet.Worksheet.insert_notes(notes:Mapping[str, str]) -> Noneinsert multiple notes.
method
gspread.worksheet.Worksheet.isSheetHidden() -> boolWorksheet hidden status.
method
gspread.worksheet.Worksheet.is_gridlines_hidden() -> boolWhether or not gridlines hidden.
method
gspread.worksheet.Worksheet.list_dimension_group_columns() -> List[JSONResponse]List all the grouped columns in this worksheet.
method
gspread.worksheet.Worksheet.list_dimension_group_rows() -> List[JSONResponse]List all the grouped rows in this worksheet.
method
gspread.worksheet.Worksheet.merge_cells(name:str, merge_type:str=MergeType.merge_all) -> AnyMerge cells.
method
gspread.worksheet.Worksheet.resize(rows:Optional[int]=None, cols:Optional[int]=None) -> JSONResponseResizes the worksheet.
method
gspread.worksheet.Worksheet.row_count() -> intNumber of rows.
method
gspread.worksheet.Worksheet.rows_auto_resize(start_row_index:int, end_row_index:int) -> JSONResponseUpdates the size of rows or columns in the worksheet.
method
gspread.worksheet.Worksheet.set_basic_filter(name:Optional[str]=None) -> AnyAdd a basic filter to the worksheet.
method
gspread.worksheet.Worksheet.show() -> JSONResponseShow the current worksheet in the UI.
method
gspread.worksheet.Worksheet.show_gridlines() -> JSONResponseShow gridlines on the current worksheet
method
gspread.worksheet.Worksheet.sort(*range:Optional[str]=None, *specs:Tuple[int, Literal['asc', 'des']]) -> JSONResponseSorts worksheet using given sort orders.
method
gspread.worksheet.Worksheet.spreadsheet() -> 'Spreadsheet'Parent spreadsheet
method
gspread.worksheet.Worksheet.tab_color() -> Optional[str]Tab color style.
method
gspread.worksheet.Worksheet.title() -> strWorksheet title.
method
gspread.worksheet.Worksheet.unhide_columns(start:int, end:int) -> JSONResponseExplicitly unhide the given column index range.
method
gspread.worksheet.Worksheet.unhide_rows(start:int, end:int) -> JSONResponseExplicitly unhide the given row index range.
method
gspread.worksheet.Worksheet.unmerge_cells(name:str) -> JSONResponseUnmerge cells.
method
gspread.worksheet.Worksheet.update_acell(label:str, value:Union[int, float, str]) -> JSONResponseUpdates the value of a cell.
method
gspread.worksheet.Worksheet.update_cell(row:int, col:int, value:Union[int, float, str]) -> JSONResponseUpdates the value of a cell.
method
gspread.worksheet.Worksheet.update_cells(cell_list:List[Cell], value_input_option:ValueInputOption=ValueInputOption.raw) -> Mapping[str, Any]Updates many cells at once.
method
gspread.worksheet.Worksheet.update_index(index:int) -> JSONResponseUpdates the ``index`` property for the worksheet.
method
gspread.worksheet.Worksheet.update_note(cell:str, content:str) -> NoneUpdate the content of the note located at `cell`.
method
gspread.worksheet.Worksheet.update_notes(notes:Mapping[str, str]) -> Noneupdate multiple notes.
method
gspread.worksheet.Worksheet.update_tab_color(color:str) -> JSONResponseChanges the worksheet's tab color.
method
gspread.worksheet.Worksheet.update_title(title:str) -> JSONResponseRenames the worksheet.
method
gspread.worksheet.Worksheet.url() -> strWorksheet URL.
この情報について
掲載しているシグネチャは burnash/gspread の公開ソースコードを
Python の ast モジュールで静的解析し、引数名・デフォルト値・
型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。
詳しくは仕組みの解説をご覧ください。