Skip to content

Commit

Permalink
Add append_rows function (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinwarby authored Mar 30, 2020
1 parent f6cfcf0 commit 4e6a2d4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gspread/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,23 @@ def append_row(

return self.spreadsheet.values_append(range_label, params, body)

def append_rows(self, values, value_input_option='RAW'):
"""Adds multiple rows to the worksheet and populates them with values.
Widens the worksheet if there are more values than columns.
:param values: List of rows each row is List of values for the new row.
"""
params = {
'valueInputOption': value_input_option
}

body = {
'values': values
}

return self.spreadsheet.values_append(self.title, params, body)

def insert_row(
self,
values,
Expand Down

0 comments on commit 4e6a2d4

Please sign in to comment.