我在 smartsheet 工作区中有 100 多张工作表。我想使用 python api 循环遍历每个工作表并将行 ID、工作表 ID 和主列附加到数组或 pandas 数据框中。
import requests
import pandas as pd
import io
import warnings
warnings.filterwarnings(action='once')
import smartsheet
import os.path
from time import gmtime, strftime
import pandas as pd
import numpy as np
import json
import requests
import hashlib
fullList = pd.DataFrame()
for sheet in sheetArray:
r = requests.get(baseURL + "/" + str(sheet), headers=headers)
rows = json.loads(r.text)
rows = rows['rows']
rowsDF = pd.DataFrame.from_dict(rows)
dropCols = ["cells","createdAt", "expanded", "modifiedAt","siblingId"]
rowsDF = rowsDF.drop(dropCols, axis=1)
fullList.append(rowsDF)