[Feature Suggestion] Multi-Row Append Function
See original GitHub issueThe current append_row function actually works for multiple rows if the square brackets in
values: [values]
are removed.
So if you copy-paste the function, remove the brackets, and call it ‘append_rows’, it now submits as many new rows to a sheet as you like.
e.g.
def append_rows(self, values, value_input_option='RAW'):
"""Adds multiple rows to the worksheet with values populated.
The input should be a list of lists, with the lists each
containing one row's values.
Widens the worksheet if there are more values than columns.
:param values: List of row lists.
"""
params = {
'valueInputOption': value_input_option
}
body = {
'majorDimension': 'ROWS',
'values': values
}
return self.spreadsheet.values_append(self.title, params, body)
Note that the majorDimension key isn’t necessary, but makes it explicit instead of relying on gsheets to figure out it’s not columns.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:5
Top Results From Across the Web
Add support for multi row INSERT
For quick multi row INSERTs (bulk inserts), it would be very useful to be able to supply multiple rows to the VALUES() constructor...
Read more >Add support for multi-row INSERT statements · Issue #455
+1 This feature would help when implementing Extract, Transform, Load jobs of millions of records where "INSERT INTO counters" adds a bit of ......
Read more >Append enabled multiline column is not getting exported
To export the appended column values (Multiline text column) completely, you can try the method As Maruthu suggested.
Read more >5 Tricks to Master Pandas append() | by B. Chen
5 Tricks to Master Pandas append() · 1. Appending a single row · 2. Appending multiple rows · 3. When column names don't...
Read more >How to Insert Multiple Rows in Excel? The 4 Best Methods
The best way to fastly add multiple rows is to use keyboard shortcuts. They are: Step 1: Click and Select the Row cells...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would like to see this too. I hit the rate limit pretty quickly without this functionality. Using the above function worked perfect for my use case (~20k rows).
@burnash is completely off the grid and seems to have abandoned this project entirely. I’ve asked him if he could give some people permission to merge PRs, but he hasn’t responded.
This is one of the biggest issues with these kinds of projects: a single maintainer becomes the single point of failure.