diff --git a/czsc/fsa/bi_table.py b/czsc/fsa/bi_table.py index ff792f7dc..80d5d89b1 100644 --- a/czsc/fsa/bi_table.py +++ b/czsc/fsa/bi_table.py @@ -22,7 +22,7 @@ def list_tables(self, app_token): https://open.feishu.cn/document/server-docs/docs/bitable-v1/app-table/list - :param app_token: 应用token + :param app_token: 一个多维表格的唯一标识。示例值:"bascnKMKGS5oD3lmCHq9euO8cGh" :return: 返回数据 """ url = f"{self.host}/open-apis/bitable/v1/apps/{app_token}/tables" @@ -33,7 +33,7 @@ def list_records(self, app_token, table_id, **kwargs): https://open.feishu.cn/document/server-docs/docs/bitable-v1/app-table-record/list - :param app_token: 应用token + :param app_token: 一个多维表格的唯一标识。示例值:"bascnKMKGS5oD3lmCHq9euO8cGh" :param table_id: 数据表id :return: 返回数据 """ @@ -51,17 +51,17 @@ def list_records(self, app_token, table_id, **kwargs): def read_table(self, app_token, table_id, **kwargs): """读取多维表格中指定表格的数据 - :param app_token: 多维表格应用token + :param app_token: 一个多维表格的唯一标识。示例值:"bascnKMKGS5oD3lmCHq9euO8cGh" :param table_id: 表格id :return: """ rows = [] - res = self.list_records(app_token, table_id, **kwargs)['data'] - total = res['total'] - rows.extend(res['items']) - while res['has_more']: - res = self.list_records(app_token, table_id, page_token=res['page_token'], **kwargs)['data'] - rows.extend(res['items']) + res = self.list_records(app_token, table_id, **kwargs)["data"] + total = res["total"] + rows.extend(res["items"]) + while res["has_more"]: + res = self.list_records(app_token, table_id, page_token=res["page_token"], **kwargs)["data"] + rows.extend(res["items"]) assert len(rows) == total, "数据读取异常" - return pd.DataFrame([x['fields'] for x in rows]) + return pd.DataFrame([x["fields"] for x in rows])