Skip to content

Commit

Permalink
add update function to worksheet module
Browse files Browse the repository at this point in the history
  • Loading branch information
imasters11 authored and dgilman committed Oct 9, 2021
1 parent 3c77dee commit 410cba0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist
*.egg-info
__pycache__

env
venv
version_tag
wheeltest
Expand Down
22 changes: 22 additions & 0 deletions gspread_asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,28 @@ async def update_cells(
self.ws.update_cells, cell_list, value_input_option=value_input_option
)

@_nowait
async def update(
self, range_name: str, values: List[List], value_input_option: str = "RAW"
):
"""Updates many cells at once. Wraps
:meth:`gspread.models.Worksheet.update`.
:param cell_list: string representing range name,
:param valuse: list of list of values to update
:param value_input_option: (optional) Determines how values should be
rendered in the the output. See
`ValueRenderOption`_ in the Sheets API.
:type value_input_option: str
:param nowait: (optional) If true, return a scheduled future instead of waiting for the API call to complete.
:type nowait: bool
.. _ValueInputOption: https://developers.google.com/sheets/api/reference/rest/v4/ValueInputOption
"""
return await self.agcm._call(
self.ws.update, range_name, values, value_input_option=value_input_option
)

@_nowait
async def update_note(self, cell: str, content: str) -> None:
"""Update the content of the note located at `cell`.
Expand Down

0 comments on commit 410cba0

Please sign in to comment.