alex_bn_lee

导航

[911] Read Data from Google Sheets into Pandas without the Google Sheets API (.gsheet)

ref: Read Data from Google Sheets into Pandas without the Google Sheets API


import pandas as pd
sheet_id = "1XqOtPkiE_Q0dfGSoyxrH730RkwrTczcRbDeJJpqRByQ"
sheet_name = "Sheet1"
url = f"https://docs.google.com/spreadsheets/d/{sheet_id}/gviz/tq?tqx=out:csv&sheet={sheet_name}"

You can find the sheet id in the url of your file behind “d/”, copy it from your browser and paste it into your code. The sheet name is the name you gave your sheet.

posted on 2023-10-18 13:10  McDelfino  阅读(7)  评论(0编辑  收藏  举报