Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add append_rows function #556

Merged
merged 1 commit into from
Mar 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions gspread/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,23 @@ def append_row(self, values, value_input_option='RAW'):

return self.spreadsheet.values_append(self.title, 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