我有一个Json对象需要上传到Google表格中。我已经搜索并阅读了各种资源,但没有找到解决方案。是否有一种方法可以使用gspread从本地上传对象或csv到Google表格?我更喜欢不使用Google客户端API。谢谢。
gspread.Client.import_csv
方法导入 CSV 数据。以下是文档中的一个快速示例:import gspread
# Check how to get `credentials`:
# https://github.com/burnash/gspread
gc = gspread.authorize(credentials)
# Read CSV file contents
content = open('file_to_import.csv', 'r').read()
gc.import_csv('<SPREADSHEET_ID>', content)
<SPREADSHEET_ID>
的电子表格的第一个工作表中。