-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for native append instead of overwrite (#16)
- Loading branch information
Showing
6 changed files
with
46 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Make available a method of later version of gspread (probably 3.4.0) | ||
# from https://github.com/burnash/gspread/pull/556 | ||
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. | ||
:param value_input_option: (optional) Determines how input data should | ||
be interpreted. See `ValueInputOption`_ in | ||
the Sheets API. | ||
:type value_input_option: str | ||
.. _ValueInputOption: https://developers.google.com/sheets/api/reference/rest/v4/ValueInputOption | ||
""" | ||
params = { | ||
'valueInputOption': value_input_option | ||
} | ||
|
||
body = { | ||
'values': values | ||
} | ||
|
||
return self.spreadsheet.values_append(self.title, params, body) |