dagster-dingtalk 0.1.19__tar.gz → 0.1.20__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dagster-dingtalk
3
- Version: 0.1.19
3
+ Version: 0.1.20
4
4
  Summary: A dagster plugin for the DingTalk
5
5
  Author: YiZixuan
6
6
  Author-email: sqkkyzx@qq.com
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Requires-Dist: dagster (>=1.8.10)
13
13
  Requires-Dist: httpx (>=0.27)
14
- Requires-Dist: pydantic (>=2,<2.10)
14
+ Requires-Dist: pydantic (>=2.10)
15
15
  Description-Content-Type: text/markdown
16
16
 
17
17
  # 钉钉与 Dagster 集成
@@ -5,7 +5,6 @@ from datetime import datetime
5
5
  from enum import Enum
6
6
  from pathlib import Path
7
7
  from typing import List, Literal
8
- import platform
9
8
 
10
9
  import httpx
11
10
  from httpx import Client
@@ -34,7 +33,7 @@ class DingTalkClient:
34
33
  self.即时通信 = 即时通信_API(self)
35
34
 
36
35
  def __get_access_token(self) -> str:
37
- access_token_cache = Path.home() / ".dingtalk_cache"
36
+ access_token_cache = Path.home() / ".dagster_dingtalk_cache"
38
37
  all_access_token: dict = {}
39
38
  access_token: str|None = None
40
39
  expire_in: int = 0
@@ -211,6 +210,20 @@ class 通讯录管理_部门管理_API:
211
210
  )
212
211
  return response.json()
213
212
 
213
+ def 获取子部门ID列表(self, dept_id: int):
214
+ """
215
+ 调用本接口,获取下一级部门基础信息。
216
+
217
+ https://open.dingtalk.com/document/orgapp/obtain-a-sub-department-id-list-v2
218
+
219
+ :param dept_id: 部门 ID ,根部门 ID 为 1。
220
+ """
221
+ response = self.__client.oapi.post(
222
+ url="/topapi/v2/department/listsubid",
223
+ json={"dept_id": dept_id}
224
+ )
225
+ return response.json()
226
+
214
227
  # noinspection NonAsciiCharacters
215
228
  class 文档文件_API:
216
229
  def __init__(self, _client:DingTalkClient):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "dagster-dingtalk"
3
- version = "0.1.19"
3
+ version = "0.1.20"
4
4
  description = "A dagster plugin for the DingTalk"
5
5
  authors = ["YiZixuan <sqkkyzx@qq.com>"]
6
6
  readme = "README.md"
@@ -8,7 +8,7 @@ readme = "README.md"
8
8
  [tool.poetry.dependencies]
9
9
  python = ">=3.10,<3.13"
10
10
  httpx = ">=0.27"
11
- pydantic = ">=2,<2.10"
11
+ pydantic = ">=2.10"
12
12
  dagster = ">=1.8.10"
13
13
 
14
14