|
@@ -312,7 +312,7 @@ class Feishu:
|
|
|
rows_count = len(cls.get_values_batch("twitter", "db114c"))
|
|
|
body = {
|
|
|
"find_condition": {
|
|
|
- "range": sheetid+"!A1:A"+str(rows_count),
|
|
|
+ "range": sheetid + "!A1:A" + str(rows_count),
|
|
|
"match_case": True, # 是否忽略大小写
|
|
|
"match_entire_cell": False, # 是否匹配整个单元格
|
|
|
"search_by_regex": False, # 是否为正则匹配
|
|
@@ -329,10 +329,569 @@ class Feishu:
|
|
|
except Exception as e:
|
|
|
Common.logger().error("查找单元格异常:{}", e)
|
|
|
|
|
|
+ # 筛选:filter
|
|
|
+ @classmethod
|
|
|
+ def filter_created_at(cls):
|
|
|
+ filter_created_at_url = "https://open.feishu.cn/open-apis/sheets/v3/spreadsheets/" \
|
|
|
+ "shtcn8fFzDhCFHpB6vzf51s2xbf/sheets/48cfb0/filter"
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.get_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ body = {
|
|
|
+ "col": "A",
|
|
|
+ "condition": {
|
|
|
+ "filter_type": "number",
|
|
|
+ "compare_type": "less",
|
|
|
+ "expected": [
|
|
|
+ "6"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.put(url=filter_created_at_url, headers=headers, json=body, proxies=proxies, verify=False)
|
|
|
+ print(r.json())
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("查找单元格异常:{}", e)
|
|
|
+
|
|
|
+
|
|
|
+class Bitable:
|
|
|
+ """
|
|
|
+ 多维表格 API
|
|
|
+ 文档地址:https://w42nne6hzg.feishu.cn/base/bascnpAYvIA0B1hBtNJlriZceUV?table=tblqMbXrpqFbDLNE&view=vewsMtek0O
|
|
|
+ app_token:bascnpAYvIA0B1hBtNJlriZceUV
|
|
|
+ """
|
|
|
+ app_token = "bascnpAYvIA0B1hBtNJlriZceUV"
|
|
|
+ table_id = "tblqMbXrpqFbDLNE"
|
|
|
+ page_token = "" # 列出记录时,翻页参数
|
|
|
+
|
|
|
+ # 获取飞书api token
|
|
|
+ @classmethod
|
|
|
+ def tenant_access_token(cls):
|
|
|
+ """
|
|
|
+ 获取飞书api token
|
|
|
+ :return:
|
|
|
+ """
|
|
|
+ time.sleep(1)
|
|
|
+ url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal/"
|
|
|
+ post_data = {"app_id": "cli_a13ad2afa438d00b", # 这里账号密码是发布应用的后台账号及密码
|
|
|
+ "app_secret": "4tK9LY9VbiQlY5umhE42dclBFo6t4p5O"}
|
|
|
+
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ response = requests.post(url=url, data=post_data, proxies=proxies, verify=False)
|
|
|
+ tenant_access_token = response.json()["tenant_access_token"]
|
|
|
+ return tenant_access_token
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("获取tenant_access_token异常:{}", e)
|
|
|
+
|
|
|
+ # 获取多维表格元数据
|
|
|
+ @classmethod
|
|
|
+ def get_apps(cls):
|
|
|
+ """
|
|
|
+ 获取多维表格元数据
|
|
|
+ 该接口支持调用频率上限为 20 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/get
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" + cls.app_token
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.get(url=url, headers=headers, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("获取多维表格元数据,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("获取多维表格元数据异常:{}", e)
|
|
|
+
|
|
|
+ # 列出数据表
|
|
|
+ @classmethod
|
|
|
+ def get_tables(cls):
|
|
|
+ """
|
|
|
+ 列出数据表
|
|
|
+ 该接口支持调用频率上限为 20 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/list
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" + cls.app_token + "/tables"
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ params = {
|
|
|
+ "page_token": "",
|
|
|
+ "page_size": ""
|
|
|
+ }
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.get(url=url, headers=headers, params=params, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("列出数据表,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("列出数据表异常:{}", e)
|
|
|
+
|
|
|
+ # 列出记录
|
|
|
+ @classmethod
|
|
|
+ def list_records(cls, count):
|
|
|
+ """
|
|
|
+ 该接口用于列出数据表中的现有记录,单次最多列出 100 行记录,支持分页获取。
|
|
|
+ 该接口支持调用频率上限为 1000 次/分钟
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/list
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" \
|
|
|
+ + cls.app_token + "/tables/" + cls.table_id + "/records"
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ params = {
|
|
|
+ "view_id": "", # 视图 id; 注意:
|
|
|
+ # 如 filter 或 sort 有值,view_id 会被忽略。
|
|
|
+ # 示例值: "vewqhz51lk"
|
|
|
+ "filter": "", # 筛选参数; 注意:
|
|
|
+ # 1.筛选记录的表达式不超过2000个字符。
|
|
|
+ # 2.不支持对“人员”以及“关联字段”的属性进行过滤筛选,如人员的 OpenID。
|
|
|
+ # 3.仅支持字段在页面展示字符值进行筛选。
|
|
|
+ # 详细参考:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/filter
|
|
|
+ # 示例值:"示例表达式:AND(CurrentValue.[身高]>180, CurrentValue.[体重]>150)"
|
|
|
+ "sort": "", # 排序参数。注意:
|
|
|
+ # 1.表达式需要不超过1000字符。
|
|
|
+ # 2.不支持对带“公式”和“关联字段”的表的使用。
|
|
|
+ # 示例值:"["字段1 DESC","字段2 ASC"]
|
|
|
+ # 注意:使用引号将字段名称和顺序逆序连接起来。"
|
|
|
+ "field_names": "[]", # 字段名称。示例值:"["字段1"]"
|
|
|
+ "text_field_as_array": True, # 控制多行文本字段数据的返回格式,true 表示以数组形式返回。注意:
|
|
|
+ # 1.多行文本中如果有超链接部分,则会返回链接的 URL。
|
|
|
+ # 2.目前可以返回多行文本中 URL 类型为多维表格链接、飞书 doc、飞书 sheet的URL类型以及@人员的数据结构。
|
|
|
+ # 示例值:true
|
|
|
+ # "user_id_type": "", # 用户 ID 类型
|
|
|
+ # 示例值:"open_id"
|
|
|
+ # 可选值有:
|
|
|
+ # open_id:用户的 open id
|
|
|
+ # union_id:用户的 union id
|
|
|
+ # user_id:用户的 user id
|
|
|
+ # 默认值:open_id
|
|
|
+ "display_formula_ref": "", # 控制公式、查找引用是否显示完整的原样返回结果。示例值:true
|
|
|
+ "automatic_fields": "", # 控制是否返回自动计算的字段
|
|
|
+ # 例如 created_by/created_time/last_modified_by/last_modified_time,true 表示返回
|
|
|
+ # 示例值:true
|
|
|
+ "page_token": "", # 分页标记
|
|
|
+ # 第一次请求不填,表示从头开始遍历;
|
|
|
+ # 分页查询结果还有更多项时会同时返回新的 page_token
|
|
|
+ # 下次遍历可采用该 page_token 获取查询结果
|
|
|
+ # 示例值:"recn0hoyXL"
|
|
|
+ "page_size": count # 分页大小。示例值:10。数据校验规则:最大值 100
|
|
|
+ }
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.get(url=url, headers=headers, params=params, proxies=proxies, verify=False)
|
|
|
+ cls.page_token = r.json()["data"]["page_token"]
|
|
|
+ items = r.json()["data"]["items"]
|
|
|
+ for item in items:
|
|
|
+ print(item)
|
|
|
+ Common.logger().info("列出记录,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("列出记录异常:{}", e)
|
|
|
+
|
|
|
+ # 检索记录
|
|
|
+ @classmethod
|
|
|
+ def search_records(cls, record_id):
|
|
|
+ """
|
|
|
+ 该接口用于根据 record_id 的值检索现有记录
|
|
|
+ 该接口支持调用频率上限为 20 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/get
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" \
|
|
|
+ + cls.app_token + "/tables/" + cls.table_id + "/records/" + record_id
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ params = {
|
|
|
+ "text_field_as_array": True, # 控制多行文本字段数据的返回格式, true 表示以数组形式返回。示例值:true
|
|
|
+ # "user_id_type": "", # 用户 ID 类型
|
|
|
+ # 示例值:"open_id"
|
|
|
+ # 可选值有:
|
|
|
+ # open_id:用户的 open id
|
|
|
+ # union_id:用户的 union id
|
|
|
+ # user_id:用户的 user id
|
|
|
+ # 默认值:open_id
|
|
|
+ "display_formula_ref": True, # 控制公式、查找引用是否显示完整的原样返回结果。示例值:true
|
|
|
+ "automatic_fields": True, # 控制是否返回自动计算的字段
|
|
|
+ # 例如 created_by/created_time/last_modified_by/last_modified_time,true 表示返回。示例值:true
|
|
|
+ }
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.get(url=url, headers=headers, params=params, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("检索记录,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("检索记录异常:{}", e)
|
|
|
+
|
|
|
+ # 新增记录
|
|
|
+ @classmethod
|
|
|
+ def create_record(cls, fields):
|
|
|
+ """
|
|
|
+ 该接口用于在数据表中新增一条记录
|
|
|
+ 该接口支持调用频率上限为 10 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/create
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" \
|
|
|
+ + cls.app_token + "/tables/" + cls.table_id + "/records"
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ body = fields
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.post(url=url, headers=headers, json=body, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("新增记录,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("新增记录异常:{}", e)
|
|
|
+
|
|
|
+ # 新增多条记录
|
|
|
+ @classmethod
|
|
|
+ def create_records(cls, records):
|
|
|
+ """
|
|
|
+ 该接口用于在数据表中新增多条记录
|
|
|
+ 该接口支持调用频率上限为 10 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_create
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" \
|
|
|
+ + cls.app_token + "/tables/" + cls.table_id + "/records/batch_create"
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ body = {
|
|
|
+ "records": records
|
|
|
+ }
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.post(url=url, headers=headers, json=body, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("新增多条记录,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("新增多条记录异常:{}", e)
|
|
|
+
|
|
|
+ # 更新记录
|
|
|
+ @classmethod
|
|
|
+ def update_record(cls, record_id, fields):
|
|
|
+ """
|
|
|
+ 该接口用于更新数据表中的一条记录
|
|
|
+ 该接口支持调用频率上限为 10 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/update
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" \
|
|
|
+ + cls.app_token + "/tables/" + cls.table_id + "/records/" + record_id
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ body = fields
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.put(url=url, headers=headers, json=body, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("更新记录,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("更新记录异常:{}", e)
|
|
|
+
|
|
|
+ # 更新多条记录
|
|
|
+ @classmethod
|
|
|
+ def update_records(cls, records):
|
|
|
+ """
|
|
|
+ 该接口用于更新数据表中的多条记录
|
|
|
+ 该接口支持调用频率上限为 10 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_update
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" \
|
|
|
+ + cls.app_token + "/tables/" + cls.table_id + "/records/batch_update"
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ body = records
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.post(url=url, headers=headers, json=body, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("更新多条记录,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("更新多条记录异常:{}", e)
|
|
|
+
|
|
|
+ # 删除记录
|
|
|
+ @classmethod
|
|
|
+ def del_record(cls, record_id):
|
|
|
+ """
|
|
|
+ 该接口用于删除数据表中的一条记录
|
|
|
+ 该接口支持调用频率上限为 10 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/delete
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" \
|
|
|
+ + cls.app_token + "/tables/" + cls.table_id + "/records/" + record_id
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.delete(url=url, headers=headers, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("删除记录,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("删除记录异常:{}", e)
|
|
|
+
|
|
|
+ # 删除多条记录
|
|
|
+ @classmethod
|
|
|
+ def del_records(cls, record_ids):
|
|
|
+ """
|
|
|
+ 该接口用于删除数据表中现有的多条记录
|
|
|
+ 该接口支持调用频率上限为 10 QPS
|
|
|
+ https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_delete
|
|
|
+ """
|
|
|
+ url = "https://open.feishu.cn/open-apis/bitable/v1/apps/" \
|
|
|
+ + cls.app_token + "/tables/" + cls.table_id + "/records/batch_delete"
|
|
|
+ headers = {
|
|
|
+ "Authorization": "Bearer " + cls.tenant_access_token(),
|
|
|
+ "Content-Type": "application/json; charset=utf-8"
|
|
|
+ }
|
|
|
+ body = {
|
|
|
+ "records": record_ids # 删除的多条记录id列表。示例值:["recIcJBbvC","recvmiCORa"]
|
|
|
+ }
|
|
|
+ try:
|
|
|
+ urllib3.disable_warnings()
|
|
|
+ r = requests.post(url=url, headers=headers, json=body, proxies=proxies, verify=False)
|
|
|
+ Common.logger().info("删除多条记录,code:{},msg:{}", r.json()["code"], r.json()["msg"])
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger().error("删除多条记录异常:{}", e)
|
|
|
+
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
- feishu = Feishu()
|
|
|
- print(feishu.find_cell("twitter", "db114c", "956929025645035522"))
|
|
|
- print(type(feishu.find_cell("twitter", "db114c", "956929025645035522")))
|
|
|
+ # feishu = Feishu()
|
|
|
+ # print(feishu.get_bitable_token())
|
|
|
+
|
|
|
+ 'reck6nLiZV'
|
|
|
+ 'recHcfJZnG'
|
|
|
+ 'recxdSMhzE'
|
|
|
+
|
|
|
+ # 实例化多维表格
|
|
|
+ bitable = Bitable()
|
|
|
+
|
|
|
+ # # 获取多维表格元数据
|
|
|
+ # bitable.get_apps()
|
|
|
+ #
|
|
|
+ # # 列出数据表
|
|
|
+ # bitable.get_tables()
|
|
|
+ #
|
|
|
+ # # 列出记录
|
|
|
+ # bitable.list_records(3)
|
|
|
+ #
|
|
|
+ # # 检索记录
|
|
|
+ # bitable.search_records("recHcfJZnG")
|
|
|
+
|
|
|
+ # # 新增一条记录
|
|
|
+ # create_value = {
|
|
|
+ # "fields": {
|
|
|
+ # "uid": "0000000000",
|
|
|
+ # "key_words": "0000000000",
|
|
|
+ # "name": "功能开发🥕",
|
|
|
+ # "screen_name": "功能开发🥕",
|
|
|
+ # "person_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/", "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "description": "功能开发🥕",
|
|
|
+ # "location": "null",
|
|
|
+ # "friends_count": 9999999999,
|
|
|
+ # "followers_count": 9999999999,
|
|
|
+ # "favourites_count": 9999999999,
|
|
|
+ # "listed_count": 9999999999,
|
|
|
+ # "statuses_count": 9999999999,
|
|
|
+ # "media_count": 9999999999,
|
|
|
+ # "display_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "created_at": 1656053209000,
|
|
|
+ # "profile_image_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "profile_banner_url": {
|
|
|
+ # "link": "null",
|
|
|
+ # "text": "null"
|
|
|
+ # },
|
|
|
+ # "ext_has_nft_avatar": "False",
|
|
|
+ # "verified": "False",
|
|
|
+ # "记录创建时间": 1656053209000,
|
|
|
+ # # "记录修改时间": ""
|
|
|
+ # }
|
|
|
+ # }
|
|
|
+ # bitable.create_record(create_value)
|
|
|
+
|
|
|
+ # 新增多条记录
|
|
|
+ # create_values = {
|
|
|
+ # "fields": {
|
|
|
+ # "uid": "0000000000",
|
|
|
+ # "key_words": "0000000000",
|
|
|
+ # "name": "功能开发🥕",
|
|
|
+ # "screen_name": "功能开发🥕",
|
|
|
+ # "person_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/", "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "description": "功能开发🥕",
|
|
|
+ # "location": "null",
|
|
|
+ # "friends_count": 9999999999,
|
|
|
+ # "followers_count": 9999999999,
|
|
|
+ # "favourites_count": 9999999999,
|
|
|
+ # "listed_count": 9999999999,
|
|
|
+ # "statuses_count": 9999999999,
|
|
|
+ # "media_count": 9999999999,
|
|
|
+ # "display_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "created_at": 1656053209000,
|
|
|
+ # "profile_image_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "profile_banner_url": {
|
|
|
+ # "link": "null",
|
|
|
+ # "text": "null"
|
|
|
+ # },
|
|
|
+ # "ext_has_nft_avatar": "False",
|
|
|
+ # "verified": "False",
|
|
|
+ # "记录创建时间": 1656053209000,
|
|
|
+ # # "记录修改时间": ""
|
|
|
+ # }
|
|
|
+ # }
|
|
|
+ # values_list = [create_values, create_values]
|
|
|
+ # bitable.create_records(values_list)
|
|
|
+
|
|
|
+ # # 更新一条记录
|
|
|
+ # use_record_id = "recxdSMhzE"
|
|
|
+ # use_fields = {
|
|
|
+ # "fields": {
|
|
|
+ # "uid": "1111111111",
|
|
|
+ # "key_words": "1111111111",
|
|
|
+ # "name": "功能开发🥕",
|
|
|
+ # "screen_name": "功能开发🥕",
|
|
|
+ # "person_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/", "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "description": "功能开发🥕",
|
|
|
+ # "location": "null",
|
|
|
+ # "friends_count": 9999999999,
|
|
|
+ # "followers_count": 9999999999,
|
|
|
+ # "favourites_count": 9999999999,
|
|
|
+ # "listed_count": 9999999999,
|
|
|
+ # "statuses_count": 9999999999,
|
|
|
+ # "media_count": 9999999999,
|
|
|
+ # "display_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "created_at": 1656053209000,
|
|
|
+ # "profile_image_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "profile_banner_url": {
|
|
|
+ # "link": "null",
|
|
|
+ # "text": "null"
|
|
|
+ # },
|
|
|
+ # "ext_has_nft_avatar": "False",
|
|
|
+ # "verified": "False",
|
|
|
+ # "记录创建时间": 1656053209000,
|
|
|
+ # # "记录修改时间": ""
|
|
|
+ # }
|
|
|
+ # }
|
|
|
+ # bitable.update_record(use_record_id, use_fields)
|
|
|
+
|
|
|
+ # # 更新多条记录
|
|
|
+ # "recxdSMhzE"
|
|
|
+ # "recHcfJZnG"
|
|
|
+ # use_records = {
|
|
|
+ # "records": [
|
|
|
+ # {
|
|
|
+ # "record_id": "recxdSMhzE",
|
|
|
+ # "fields": {
|
|
|
+ # "uid": "3333333333",
|
|
|
+ # "key_words": "3333333333",
|
|
|
+ # "name": "功能开发🥕",
|
|
|
+ # "screen_name": "功能开发🥕",
|
|
|
+ # "person_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "description": "功能开发🥕",
|
|
|
+ # "location": "null",
|
|
|
+ # "friends_count": 9999999999,
|
|
|
+ # "followers_count": 9999999999,
|
|
|
+ # "favourites_count": 9999999999,
|
|
|
+ # "listed_count": 9999999999,
|
|
|
+ # "statuses_count": 9999999999,
|
|
|
+ # "media_count": 9999999999,
|
|
|
+ # "display_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "created_at": 1656053209000,
|
|
|
+ # "profile_image_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "profile_banner_url": {
|
|
|
+ # "link": "null",
|
|
|
+ # "text": "null"
|
|
|
+ # },
|
|
|
+ # "ext_has_nft_avatar": "False",
|
|
|
+ # "verified": "False",
|
|
|
+ # "记录创建时间": 1656053209000,
|
|
|
+ # # "记录修改时间": ""
|
|
|
+ # }
|
|
|
+ # },
|
|
|
+ # {
|
|
|
+ # "record_id": "recHcfJZnG",
|
|
|
+ # "fields": {
|
|
|
+ # "uid": "3333333333",
|
|
|
+ # "key_words": "3333333333",
|
|
|
+ # "name": "功能开发🥕",
|
|
|
+ # "screen_name": "功能开发🥕",
|
|
|
+ # "person_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "description": "功能开发🥕",
|
|
|
+ # "location": "null",
|
|
|
+ # "friends_count": 9999999999,
|
|
|
+ # "followers_count": 9999999999,
|
|
|
+ # "favourites_count": 9999999999,
|
|
|
+ # "listed_count": 9999999999,
|
|
|
+ # "statuses_count": 9999999999,
|
|
|
+ # "media_count": 9999999999,
|
|
|
+ # "display_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "created_at": 1656053209000,
|
|
|
+ # "profile_image_url": {
|
|
|
+ # "link": "https://bytedance.feishu.cn/drive/home/",
|
|
|
+ # "text": "https://bytedance.feishu.cn/drive/home/"
|
|
|
+ # },
|
|
|
+ # "profile_banner_url": {
|
|
|
+ # "link": "null",
|
|
|
+ # "text": "null"
|
|
|
+ # },
|
|
|
+ # "ext_has_nft_avatar": "False",
|
|
|
+ # "verified": "False",
|
|
|
+ # "记录创建时间": 1656053209000,
|
|
|
+ # # "记录修改时间": ""
|
|
|
+ # }
|
|
|
+ # }
|
|
|
+ # ]
|
|
|
+ # }
|
|
|
+ # bitable.update_records(use_records)
|
|
|
+
|
|
|
+ # # 删除一条记录
|
|
|
+ # bitable.del_record("reck6nLiZV")
|
|
|
|
|
|
- pass
|
|
|
+ # # 删除多条记录
|
|
|
+ # bitable.del_records(['recHcfJZnG', 'recxdSMhzE'])
|