from api import API
import pandas as pd
from tqdm import tqdm

api_instance = API()

df = pd.read_excel(fr"C:\Users\zy187\Desktop\钉钉文件\功能使用情况_20251128102519.xlsx",sheet_name="功能使用情况")

all_data =  []
for index,row in tqdm(df.iterrows(),total=len(df)):
    # print(row["data_id"])
    payload = {
        "data_id": row["data_id"]
        , "api_key": "675b900991ad2491c69389ca"
        , "entry_id": "6763bbf657bd8fb76fcb41b2"
    }
    res = api_instance.entry_data_get(payload)


    org_name = res.get("data").get("_widget_1734589432084")
    all_data.append([row["data_id"],org_name])

df1 = pd.DataFrame(all_data)
df1.to_excel(fr"C:\Users\zy187\Desktop\钉钉文件\功能使用情况_20251128102519_data_id.xlsx",index=False)
