gspread
https://docs.gspread.org/en/v5.7.1/
gspread is a Python API for Google Sheets.
Features:
Google Sheets API v4.
Open a spreadsheet by title, key or url.
Read, write, and format cell ranges.
Sharing and access control.
Batching updates.
Google Sheets(Spreadsheet)をPython で操作できるライブラリ
インストール
$ pip install gspread
簡単な使い方
code:py
import gspread
gc = gspread.service_account()
# Open a sheet from a spreadsheet in one go
wks = gc.open("Where is the money Lebowski?").sheet1
# Update a range of cells using the top left corner address
wks.update('A1', 1, 2], [3, 4)
# Or update a single cell
wks.update('B42', "it's down there somewhere, let me take another look.")
# Format the header
gspread で Python から Google スプレッドシートを扱えるようにするまで