python-cnb 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_cnb-0.2.0/python_cnb.egg-info → python_cnb-0.3.0}/PKG-INFO +38 -4
- {python_cnb-0.2.0 → python_cnb-0.3.0}/README.md +37 -3
- {python_cnb-0.2.0 → python_cnb-0.3.0/python_cnb.egg-info}/PKG-INFO +38 -4
- {python_cnb-0.2.0 → python_cnb-0.3.0}/setup.py +1 -1
- {python_cnb-0.2.0 → python_cnb-0.3.0}/LICENSE +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/MANIFEST.in +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/__init__.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/artifactory.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/assets.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/build.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/client.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/cnb.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/collaborators.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/contributors.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/exceptions.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/followers.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/git.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/gitsettings.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/issues.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/missions.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/__init__.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/api.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/chart.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/constant.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/convert.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/die.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/dto.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_web.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/git_woa_com_cnb_monorepo_git_internal_dto_web.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/git_woa_com_cnb_monorepo_mission_mission_resource_dto_web.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/handler.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/http.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/identity.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/label.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/map_constant.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/models.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/openapi.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/organization.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/organizations.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/scope.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/v1.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/web.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/webapi.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/wechat.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/organizations.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/pulls.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/releases.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/repocontributor.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/repolabels.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/repositories.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/starring.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/users.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/workspace.py +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/pyproject.toml +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/python_cnb.egg-info/SOURCES.txt +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/python_cnb.egg-info/dependency_links.txt +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/python_cnb.egg-info/requires.txt +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/python_cnb.egg-info/top_level.txt +0 -0
- {python_cnb-0.2.0 → python_cnb-0.3.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-cnb
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: CNB OpenAPI的Python SDK,方便与CNB平台进行交互
|
|
5
5
|
Home-page: https://cnb.cool
|
|
6
6
|
Author: Tencent Cloud
|
|
@@ -66,7 +66,18 @@ pip install python-cnb
|
|
|
66
66
|
## 快速开始
|
|
67
67
|
|
|
68
68
|
```python
|
|
69
|
-
|
|
69
|
+
#!/usr/bin/env python
|
|
70
|
+
|
|
71
|
+
import os
|
|
72
|
+
from dotenv import load_dotenv
|
|
73
|
+
from cnb import CNBClient
|
|
74
|
+
from cnb.exceptions import CNBAPIError
|
|
75
|
+
from cnb.models import api
|
|
76
|
+
|
|
77
|
+
# 加载环境变量
|
|
78
|
+
load_dotenv()
|
|
79
|
+
|
|
80
|
+
def get_user_info():
|
|
70
81
|
# 初始化客户端
|
|
71
82
|
client = CNBClient(
|
|
72
83
|
base_url="https://api.cnb.cool",
|
|
@@ -77,13 +88,36 @@ def sync_api_demo():
|
|
|
77
88
|
|
|
78
89
|
try:
|
|
79
90
|
user_info = client.cnb.users.get_user_info()
|
|
80
|
-
print(f"
|
|
91
|
+
print(f"user_info: {user_info}")
|
|
81
92
|
|
|
82
93
|
except CNBAPIError as e:
|
|
83
94
|
print(f"API调用失败: {e}")
|
|
84
95
|
|
|
96
|
+
def create_issue():
|
|
97
|
+
# 初始化客户端
|
|
98
|
+
client = CNBClient(
|
|
99
|
+
base_url="https://api.cnb.cool",
|
|
100
|
+
api_key=os.getenv("CNB_TOKEN"), # 从环境变量获取API Key
|
|
101
|
+
max_retries=3, # 最大重试次数
|
|
102
|
+
timeout=30, # 请求超时时间(秒)
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
try:
|
|
106
|
+
issue = client.cnb.issues.create_issue(
|
|
107
|
+
repo="looc/test-ci",
|
|
108
|
+
body_params=api.PostIssueForm(
|
|
109
|
+
title="测试 Issue",
|
|
110
|
+
priority="111"
|
|
111
|
+
)
|
|
112
|
+
)
|
|
113
|
+
print(f"issue: {issue}")
|
|
114
|
+
|
|
115
|
+
except CNBAPIError as e:
|
|
116
|
+
print(f"API调用失败: {e.errcode}")
|
|
117
|
+
|
|
85
118
|
if __name__ == "__main__":
|
|
86
|
-
|
|
119
|
+
get_user_info()
|
|
120
|
+
list_issues()
|
|
87
121
|
|
|
88
122
|
```
|
|
89
123
|
|
|
@@ -29,7 +29,18 @@ pip install python-cnb
|
|
|
29
29
|
## 快速开始
|
|
30
30
|
|
|
31
31
|
```python
|
|
32
|
-
|
|
32
|
+
#!/usr/bin/env python
|
|
33
|
+
|
|
34
|
+
import os
|
|
35
|
+
from dotenv import load_dotenv
|
|
36
|
+
from cnb import CNBClient
|
|
37
|
+
from cnb.exceptions import CNBAPIError
|
|
38
|
+
from cnb.models import api
|
|
39
|
+
|
|
40
|
+
# 加载环境变量
|
|
41
|
+
load_dotenv()
|
|
42
|
+
|
|
43
|
+
def get_user_info():
|
|
33
44
|
# 初始化客户端
|
|
34
45
|
client = CNBClient(
|
|
35
46
|
base_url="https://api.cnb.cool",
|
|
@@ -40,13 +51,36 @@ def sync_api_demo():
|
|
|
40
51
|
|
|
41
52
|
try:
|
|
42
53
|
user_info = client.cnb.users.get_user_info()
|
|
43
|
-
print(f"
|
|
54
|
+
print(f"user_info: {user_info}")
|
|
44
55
|
|
|
45
56
|
except CNBAPIError as e:
|
|
46
57
|
print(f"API调用失败: {e}")
|
|
47
58
|
|
|
59
|
+
def create_issue():
|
|
60
|
+
# 初始化客户端
|
|
61
|
+
client = CNBClient(
|
|
62
|
+
base_url="https://api.cnb.cool",
|
|
63
|
+
api_key=os.getenv("CNB_TOKEN"), # 从环境变量获取API Key
|
|
64
|
+
max_retries=3, # 最大重试次数
|
|
65
|
+
timeout=30, # 请求超时时间(秒)
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
issue = client.cnb.issues.create_issue(
|
|
70
|
+
repo="looc/test-ci",
|
|
71
|
+
body_params=api.PostIssueForm(
|
|
72
|
+
title="测试 Issue",
|
|
73
|
+
priority="111"
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
print(f"issue: {issue}")
|
|
77
|
+
|
|
78
|
+
except CNBAPIError as e:
|
|
79
|
+
print(f"API调用失败: {e.errcode}")
|
|
80
|
+
|
|
48
81
|
if __name__ == "__main__":
|
|
49
|
-
|
|
82
|
+
get_user_info()
|
|
83
|
+
list_issues()
|
|
50
84
|
|
|
51
85
|
```
|
|
52
86
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-cnb
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: CNB OpenAPI的Python SDK,方便与CNB平台进行交互
|
|
5
5
|
Home-page: https://cnb.cool
|
|
6
6
|
Author: Tencent Cloud
|
|
@@ -66,7 +66,18 @@ pip install python-cnb
|
|
|
66
66
|
## 快速开始
|
|
67
67
|
|
|
68
68
|
```python
|
|
69
|
-
|
|
69
|
+
#!/usr/bin/env python
|
|
70
|
+
|
|
71
|
+
import os
|
|
72
|
+
from dotenv import load_dotenv
|
|
73
|
+
from cnb import CNBClient
|
|
74
|
+
from cnb.exceptions import CNBAPIError
|
|
75
|
+
from cnb.models import api
|
|
76
|
+
|
|
77
|
+
# 加载环境变量
|
|
78
|
+
load_dotenv()
|
|
79
|
+
|
|
80
|
+
def get_user_info():
|
|
70
81
|
# 初始化客户端
|
|
71
82
|
client = CNBClient(
|
|
72
83
|
base_url="https://api.cnb.cool",
|
|
@@ -77,13 +88,36 @@ def sync_api_demo():
|
|
|
77
88
|
|
|
78
89
|
try:
|
|
79
90
|
user_info = client.cnb.users.get_user_info()
|
|
80
|
-
print(f"
|
|
91
|
+
print(f"user_info: {user_info}")
|
|
81
92
|
|
|
82
93
|
except CNBAPIError as e:
|
|
83
94
|
print(f"API调用失败: {e}")
|
|
84
95
|
|
|
96
|
+
def create_issue():
|
|
97
|
+
# 初始化客户端
|
|
98
|
+
client = CNBClient(
|
|
99
|
+
base_url="https://api.cnb.cool",
|
|
100
|
+
api_key=os.getenv("CNB_TOKEN"), # 从环境变量获取API Key
|
|
101
|
+
max_retries=3, # 最大重试次数
|
|
102
|
+
timeout=30, # 请求超时时间(秒)
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
try:
|
|
106
|
+
issue = client.cnb.issues.create_issue(
|
|
107
|
+
repo="looc/test-ci",
|
|
108
|
+
body_params=api.PostIssueForm(
|
|
109
|
+
title="测试 Issue",
|
|
110
|
+
priority="111"
|
|
111
|
+
)
|
|
112
|
+
)
|
|
113
|
+
print(f"issue: {issue}")
|
|
114
|
+
|
|
115
|
+
except CNBAPIError as e:
|
|
116
|
+
print(f"API调用失败: {e.errcode}")
|
|
117
|
+
|
|
85
118
|
if __name__ == "__main__":
|
|
86
|
-
|
|
119
|
+
get_user_info()
|
|
120
|
+
list_issues()
|
|
87
121
|
|
|
88
122
|
```
|
|
89
123
|
|
|
@@ -7,7 +7,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name="python-cnb",
|
|
10
|
-
version="0.
|
|
10
|
+
version="0.3.0",
|
|
11
11
|
author="Tencent Cloud",
|
|
12
12
|
author_email="ericdduan@tencent.com",
|
|
13
13
|
description="CNB OpenAPI的Python SDK,方便与CNB平台进行交互",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_cnb-0.2.0 → python_cnb-0.3.0}/cnb/models/git_woa_com_cnb_monorepo_git_internal_dto_web.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|