0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Python・API制限回避】gspreadで最終行に行を大量追加する方法

Posted at

前置き

ログや情報をスプレッドシートに書き込む際、最終行に大量の行を追加したいことありますよね。
API制限を考えると空の行を確認して、update_cellを使うなど絶対に避けたいところです。

追加方法

スプレッドシートが3列ある場合

exsample.py
append_list = [ ["A", "B", "C"], ["D", "E", "F"], ["G", "H", "I"] ]
worksheet.append_rows(append_list)

2次元配列を用意しappend_rowsとやることで1度のリクエストのみで3行も追加することができました。3行だけでなく、もっと追加することもできるので、必要に応じてやってみてください。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?