prism.py.client 1.0.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.
Files changed (72) hide show
  1. prism_py_client-1.0.0/PKG-INFO +222 -0
  2. prism_py_client-1.0.0/README.md +184 -0
  3. prism_py_client-1.0.0/openapi_client/__init__.py +96 -0
  4. prism_py_client-1.0.0/openapi_client/api/__init__.py +9 -0
  5. prism_py_client-1.0.0/openapi_client/api/dashboard_api.py +1340 -0
  6. prism_py_client-1.0.0/openapi_client/api/project_api.py +1620 -0
  7. prism_py_client-1.0.0/openapi_client/api/test_build_api.py +2706 -0
  8. prism_py_client-1.0.0/openapi_client/api/test_job_api.py +1620 -0
  9. prism_py_client-1.0.0/openapi_client/api/test_result_api.py +3559 -0
  10. prism_py_client-1.0.0/openapi_client/api_client.py +804 -0
  11. prism_py_client-1.0.0/openapi_client/api_response.py +21 -0
  12. prism_py_client-1.0.0/openapi_client/configuration.py +596 -0
  13. prism_py_client-1.0.0/openapi_client/exceptions.py +218 -0
  14. prism_py_client-1.0.0/openapi_client/models/__init__.py +38 -0
  15. prism_py_client-1.0.0/openapi_client/models/device_under_test.py +110 -0
  16. prism_py_client-1.0.0/openapi_client/models/func_string_task_boolean.py +92 -0
  17. prism_py_client-1.0.0/openapi_client/models/product.py +130 -0
  18. prism_py_client-1.0.0/openapi_client/models/project.py +112 -0
  19. prism_py_client-1.0.0/openapi_client/models/release.py +100 -0
  20. prism_py_client-1.0.0/openapi_client/models/result_type.py +121 -0
  21. prism_py_client-1.0.0/openapi_client/models/script.py +114 -0
  22. prism_py_client-1.0.0/openapi_client/models/script_repository.py +104 -0
  23. prism_py_client-1.0.0/openapi_client/models/test_build.py +145 -0
  24. prism_py_client-1.0.0/openapi_client/models/test_case.py +116 -0
  25. prism_py_client-1.0.0/openapi_client/models/test_environment.py +81 -0
  26. prism_py_client-1.0.0/openapi_client/models/test_job.py +152 -0
  27. prism_py_client-1.0.0/openapi_client/models/test_job_parameter.py +104 -0
  28. prism_py_client-1.0.0/openapi_client/models/test_job_report_template.py +118 -0
  29. prism_py_client-1.0.0/openapi_client/models/test_machine.py +112 -0
  30. prism_py_client-1.0.0/openapi_client/models/test_metadata.py +81 -0
  31. prism_py_client-1.0.0/openapi_client/models/test_parameter.py +81 -0
  32. prism_py_client-1.0.0/openapi_client/models/test_plan.py +112 -0
  33. prism_py_client-1.0.0/openapi_client/models/test_plan_recipe.py +116 -0
  34. prism_py_client-1.0.0/openapi_client/models/test_report.py +110 -0
  35. prism_py_client-1.0.0/openapi_client/models/test_result.py +105 -0
  36. prism_py_client-1.0.0/openapi_client/models/test_suite.py +102 -0
  37. prism_py_client-1.0.0/openapi_client/models/user_credential.py +122 -0
  38. prism_py_client-1.0.0/openapi_client/py.typed +0 -0
  39. prism_py_client-1.0.0/openapi_client/rest.py +263 -0
  40. prism_py_client-1.0.0/prism.py.client.egg-info/PKG-INFO +222 -0
  41. prism_py_client-1.0.0/prism.py.client.egg-info/SOURCES.txt +71 -0
  42. prism_py_client-1.0.0/prism.py.client.egg-info/dependency_links.txt +1 -0
  43. prism_py_client-1.0.0/prism.py.client.egg-info/requires.txt +4 -0
  44. prism_py_client-1.0.0/prism.py.client.egg-info/top_level.txt +1 -0
  45. prism_py_client-1.0.0/pyproject.toml +73 -0
  46. prism_py_client-1.0.0/setup.cfg +7 -0
  47. prism_py_client-1.0.0/setup.py +59 -0
  48. prism_py_client-1.0.0/test/test_dashboard_api.py +61 -0
  49. prism_py_client-1.0.0/test/test_device_under_test.py +440 -0
  50. prism_py_client-1.0.0/test/test_func_string_task_boolean.py +52 -0
  51. prism_py_client-1.0.0/test/test_product.py +819 -0
  52. prism_py_client-1.0.0/test/test_project.py +476 -0
  53. prism_py_client-1.0.0/test/test_project_api.py +67 -0
  54. prism_py_client-1.0.0/test/test_release.py +244 -0
  55. prism_py_client-1.0.0/test/test_result_type.py +728 -0
  56. prism_py_client-1.0.0/test/test_script.py +501 -0
  57. prism_py_client-1.0.0/test/test_script_repository.py +273 -0
  58. prism_py_client-1.0.0/test/test_test_build.py +1181 -0
  59. prism_py_client-1.0.0/test/test_test_build_api.py +91 -0
  60. prism_py_client-1.0.0/test/test_test_case.py +745 -0
  61. prism_py_client-1.0.0/test/test_test_job.py +1343 -0
  62. prism_py_client-1.0.0/test/test_test_job_api.py +67 -0
  63. prism_py_client-1.0.0/test/test_test_job_parameter.py +284 -0
  64. prism_py_client-1.0.0/test/test_test_job_report_template.py +509 -0
  65. prism_py_client-1.0.0/test/test_test_machine.py +434 -0
  66. prism_py_client-1.0.0/test/test_test_plan.py +476 -0
  67. prism_py_client-1.0.0/test/test_test_plan_recipe.py +720 -0
  68. prism_py_client-1.0.0/test/test_test_report.py +516 -0
  69. prism_py_client-1.0.0/test/test_test_result.py +513 -0
  70. prism_py_client-1.0.0/test/test_test_result_api.py +103 -0
  71. prism_py_client-1.0.0/test/test_test_suite.py +283 -0
  72. prism_py_client-1.0.0/test/test_user_credential.py +477 -0
@@ -0,0 +1,222 @@
1
+ Metadata-Version: 2.4
2
+ Name: prism.py.client
3
+ Version: 1.0.0
4
+ Summary: Python client for prism.web.service
5
+ Home-page: https://github.com/shangerxin/prism.client
6
+ Author: Shang, Erxin
7
+ Author-email: shangerxin@hotmail.com
8
+ License: MIT
9
+ Project-URL: Repository, https://github.com/shangerxin/prism.client
10
+ Keywords: prism,prism.python.client,prism.py.client
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ Requires-Dist: urllib3<3.0.0,>=2.1.0
23
+ Requires-Dist: python-dateutil>=2.8.2
24
+ Requires-Dist: pydantic>=2.11
25
+ Requires-Dist: typing-extensions>=4.7.1
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: description-content-type
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: project-url
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ # Prism Python Client
40
+
41
+ Python helper for uploading benchmark and test artifacts to a Prism server.
42
+
43
+ This README is intentionally focused on `prism_client.py` usage and examples.
44
+
45
+ ## Requirements
46
+
47
+ - Python 3.10+
48
+
49
+ ## Install
50
+
51
+ From this folder:
52
+
53
+ ```sh
54
+ pip install -r requirements.txt
55
+ ```
56
+
57
+ Optional editable install:
58
+
59
+ ```sh
60
+ pip install -e .
61
+ ```
62
+
63
+ ## What `prism_client.py` Uploads
64
+
65
+ The script can upload four metadata types:
66
+
67
+ - `result`: test result payload to `POST /TestResult/AddResult/`
68
+ - `env`: environment payload to `POST /TestResult/AddEnvirnoment/`
69
+ - `param`: parameter payload to `POST /TestResult/AddParameter/`
70
+ - `meta`: metadata payload to `POST /TestResult/AddMetadata/`
71
+
72
+ `host` should include the API prefix, for example `https://localhost:44303/api/v1`.
73
+
74
+ ## CLI Usage
75
+
76
+ ```sh
77
+ python prism_client.py host -t TEST_JOB -p PROJECT -m {env,meta,param,result} -n NAME (-j JSON | -c CSV) [options]
78
+ ```
79
+
80
+ Required arguments:
81
+
82
+ - `host`: Prism server API root URL
83
+ - `-t, --test-job`: test job name
84
+ - `-p, --project`: project name
85
+ - `-m, --meta-type`: one of `env`, `meta`, `param`, `result`
86
+ - `-n, --name`: unique label (`dataInfo`) for the uploaded payload
87
+ - one of `-j, --json` or `-c, --csv`
88
+
89
+ Optional arguments:
90
+
91
+ - `-g, --build-guid`: build [GUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) (auto-generated if omitted)
92
+ - `-s, --start`: start time ([ISO string](https://en.wikipedia.org/wiki/ISO_8601), defaults to current time)
93
+ - `-e, --end`: end time ([ISO string](https://en.wikipedia.org/wiki/ISO_8601), defaults to current time)
94
+ - `-x, --timeout-hours`: timeout in hours (default `0`)
95
+ - `-b, --build-result`: one of `NotExecuted|Pass|Fail|Blocked|InProgress|Hang|Paused|Aborted`
96
+ - `-r, --test-result`: one of `NotExecuted|Pass|Fail|Blocked|InProgress|Hang|Paused|Aborted`
97
+
98
+ ## Example: Upload Test Result From JSON
99
+
100
+ Create `result.json`:
101
+
102
+ ```json
103
+ {
104
+ "summary": {
105
+ "throughput": 1234,
106
+ "latency_ms": 21.4,
107
+ "passed": true
108
+ },
109
+ "details": [
110
+ {
111
+ "name": "case_001",
112
+ "status": "Pass",
113
+ "duration_ms": 120
114
+ }
115
+ ]
116
+ }
117
+ ```
118
+
119
+ Run:
120
+
121
+ ```sh
122
+ python prism_client.py https://your-prism-server/api/v1 \
123
+ -p YourProject \
124
+ -t YourTestJob \
125
+ -m result \
126
+ -n benchmark-run-20260609 \
127
+ -j result.json \
128
+ -b Pass \
129
+ -r Pass
130
+ ```
131
+
132
+ ## Example: Upload Test Result From CSV
133
+
134
+ If you provide CSV, the script converts it to JSON before upload.
135
+
136
+ ```sh
137
+ python prism_client.py https://your-prism-server/api/v1 \
138
+ -p YourProject \
139
+ -t YourTestJob \
140
+ -m result \
141
+ -n benchmark-run-csv \
142
+ -c result.csv \
143
+ -b Pass \
144
+ -r Pass
145
+ ```
146
+
147
+ ## Example: Upload Environment / Parameter / Metadata
148
+
149
+ Environment:
150
+
151
+ ```sh
152
+ python prism_client.py https://your-prism-server/api/v1 \
153
+ -p YourProject \
154
+ -t YourTestJob \
155
+ -m env \
156
+ -n hw-sw-info \
157
+ -j environment.json
158
+ ```
159
+
160
+ Parameter:
161
+
162
+ ```sh
163
+ python prism_client.py https://your-prism-server/api/v1 \
164
+ -p YourProject \
165
+ -t YourTestJob \
166
+ -m param \
167
+ -n runtime-args \
168
+ -j parameters.json
169
+ ```
170
+
171
+ Metadata:
172
+
173
+ ```sh
174
+ python prism_client.py https://your-prism-server/api/v1 \
175
+ -p YourProject \
176
+ -t YourTestJob \
177
+ -m meta \
178
+ -n build-info \
179
+ -j metadata.json
180
+ ```
181
+
182
+ ## Python API Example (Using `prism_client.py` Functions)
183
+
184
+ ```python
185
+ import json
186
+ import uuid
187
+ from datetime import datetime, timezone
188
+
189
+ from prism_client import upload_result
190
+
191
+ host = "https://your-prism-server/api/v1"
192
+ project = "YourProject"
193
+ test_job = "YourTestJob"
194
+ name = "benchmark-run-20260609"
195
+
196
+ with open("result.json", "r", encoding="utf-8") as f:
197
+ payload = json.load(f)
198
+
199
+ upload_result(
200
+ host=host,
201
+ project=project,
202
+ test_job=test_job,
203
+ name=name,
204
+ data=payload,
205
+ build_guid=str(uuid.uuid4()),
206
+ build_result="Pass",
207
+ test_result="Pass",
208
+ start=datetime.now(timezone.utc).isoformat(),
209
+ end=datetime.now(timezone.utc).isoformat(),
210
+ timeout_hours=0,
211
+ )
212
+ ```
213
+
214
+ ## Run Tests
215
+
216
+ ```sh
217
+ pytest
218
+ ```
219
+
220
+
221
+
222
+
@@ -0,0 +1,184 @@
1
+ # Prism Python Client
2
+
3
+ Python helper for uploading benchmark and test artifacts to a Prism server.
4
+
5
+ This README is intentionally focused on `prism_client.py` usage and examples.
6
+
7
+ ## Requirements
8
+
9
+ - Python 3.10+
10
+
11
+ ## Install
12
+
13
+ From this folder:
14
+
15
+ ```sh
16
+ pip install -r requirements.txt
17
+ ```
18
+
19
+ Optional editable install:
20
+
21
+ ```sh
22
+ pip install -e .
23
+ ```
24
+
25
+ ## What `prism_client.py` Uploads
26
+
27
+ The script can upload four metadata types:
28
+
29
+ - `result`: test result payload to `POST /TestResult/AddResult/`
30
+ - `env`: environment payload to `POST /TestResult/AddEnvirnoment/`
31
+ - `param`: parameter payload to `POST /TestResult/AddParameter/`
32
+ - `meta`: metadata payload to `POST /TestResult/AddMetadata/`
33
+
34
+ `host` should include the API prefix, for example `https://localhost:44303/api/v1`.
35
+
36
+ ## CLI Usage
37
+
38
+ ```sh
39
+ python prism_client.py host -t TEST_JOB -p PROJECT -m {env,meta,param,result} -n NAME (-j JSON | -c CSV) [options]
40
+ ```
41
+
42
+ Required arguments:
43
+
44
+ - `host`: Prism server API root URL
45
+ - `-t, --test-job`: test job name
46
+ - `-p, --project`: project name
47
+ - `-m, --meta-type`: one of `env`, `meta`, `param`, `result`
48
+ - `-n, --name`: unique label (`dataInfo`) for the uploaded payload
49
+ - one of `-j, --json` or `-c, --csv`
50
+
51
+ Optional arguments:
52
+
53
+ - `-g, --build-guid`: build [GUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) (auto-generated if omitted)
54
+ - `-s, --start`: start time ([ISO string](https://en.wikipedia.org/wiki/ISO_8601), defaults to current time)
55
+ - `-e, --end`: end time ([ISO string](https://en.wikipedia.org/wiki/ISO_8601), defaults to current time)
56
+ - `-x, --timeout-hours`: timeout in hours (default `0`)
57
+ - `-b, --build-result`: one of `NotExecuted|Pass|Fail|Blocked|InProgress|Hang|Paused|Aborted`
58
+ - `-r, --test-result`: one of `NotExecuted|Pass|Fail|Blocked|InProgress|Hang|Paused|Aborted`
59
+
60
+ ## Example: Upload Test Result From JSON
61
+
62
+ Create `result.json`:
63
+
64
+ ```json
65
+ {
66
+ "summary": {
67
+ "throughput": 1234,
68
+ "latency_ms": 21.4,
69
+ "passed": true
70
+ },
71
+ "details": [
72
+ {
73
+ "name": "case_001",
74
+ "status": "Pass",
75
+ "duration_ms": 120
76
+ }
77
+ ]
78
+ }
79
+ ```
80
+
81
+ Run:
82
+
83
+ ```sh
84
+ python prism_client.py https://your-prism-server/api/v1 \
85
+ -p YourProject \
86
+ -t YourTestJob \
87
+ -m result \
88
+ -n benchmark-run-20260609 \
89
+ -j result.json \
90
+ -b Pass \
91
+ -r Pass
92
+ ```
93
+
94
+ ## Example: Upload Test Result From CSV
95
+
96
+ If you provide CSV, the script converts it to JSON before upload.
97
+
98
+ ```sh
99
+ python prism_client.py https://your-prism-server/api/v1 \
100
+ -p YourProject \
101
+ -t YourTestJob \
102
+ -m result \
103
+ -n benchmark-run-csv \
104
+ -c result.csv \
105
+ -b Pass \
106
+ -r Pass
107
+ ```
108
+
109
+ ## Example: Upload Environment / Parameter / Metadata
110
+
111
+ Environment:
112
+
113
+ ```sh
114
+ python prism_client.py https://your-prism-server/api/v1 \
115
+ -p YourProject \
116
+ -t YourTestJob \
117
+ -m env \
118
+ -n hw-sw-info \
119
+ -j environment.json
120
+ ```
121
+
122
+ Parameter:
123
+
124
+ ```sh
125
+ python prism_client.py https://your-prism-server/api/v1 \
126
+ -p YourProject \
127
+ -t YourTestJob \
128
+ -m param \
129
+ -n runtime-args \
130
+ -j parameters.json
131
+ ```
132
+
133
+ Metadata:
134
+
135
+ ```sh
136
+ python prism_client.py https://your-prism-server/api/v1 \
137
+ -p YourProject \
138
+ -t YourTestJob \
139
+ -m meta \
140
+ -n build-info \
141
+ -j metadata.json
142
+ ```
143
+
144
+ ## Python API Example (Using `prism_client.py` Functions)
145
+
146
+ ```python
147
+ import json
148
+ import uuid
149
+ from datetime import datetime, timezone
150
+
151
+ from prism_client import upload_result
152
+
153
+ host = "https://your-prism-server/api/v1"
154
+ project = "YourProject"
155
+ test_job = "YourTestJob"
156
+ name = "benchmark-run-20260609"
157
+
158
+ with open("result.json", "r", encoding="utf-8") as f:
159
+ payload = json.load(f)
160
+
161
+ upload_result(
162
+ host=host,
163
+ project=project,
164
+ test_job=test_job,
165
+ name=name,
166
+ data=payload,
167
+ build_guid=str(uuid.uuid4()),
168
+ build_result="Pass",
169
+ test_result="Pass",
170
+ start=datetime.now(timezone.utc).isoformat(),
171
+ end=datetime.now(timezone.utc).isoformat(),
172
+ timeout_hours=0,
173
+ )
174
+ ```
175
+
176
+ ## Run Tests
177
+
178
+ ```sh
179
+ pytest
180
+ ```
181
+
182
+
183
+
184
+
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ prism.web.service
7
+
8
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
9
+
10
+ The version of the OpenAPI document: v1
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "1.0.0"
18
+
19
+ # Define package exports
20
+ __all__ = [
21
+ "DashboardApi",
22
+ "ProjectApi",
23
+ "TestBuildApi",
24
+ "TestJobApi",
25
+ "TestResultApi",
26
+ "ApiResponse",
27
+ "ApiClient",
28
+ "Configuration",
29
+ "OpenApiException",
30
+ "ApiTypeError",
31
+ "ApiValueError",
32
+ "ApiKeyError",
33
+ "ApiAttributeError",
34
+ "ApiException",
35
+ "DeviceUnderTest",
36
+ "FuncStringTaskBoolean",
37
+ "Product",
38
+ "Project",
39
+ "Release",
40
+ "ResultType",
41
+ "Script",
42
+ "ScriptRepository",
43
+ "TestBuild",
44
+ "TestCase",
45
+ "TestJob",
46
+ "TestJobParameter",
47
+ "TestJobReportTemplate",
48
+ "TestMachine",
49
+ "TestPlan",
50
+ "TestPlanRecipe",
51
+ "TestReport",
52
+ "TestResult",
53
+ "TestSuite",
54
+ "UserCredential",
55
+ ]
56
+
57
+ # import apis into sdk package
58
+ from openapi_client.api.dashboard_api import DashboardApi as DashboardApi
59
+ from openapi_client.api.project_api import ProjectApi as ProjectApi
60
+ from openapi_client.api.test_build_api import TestBuildApi as TestBuildApi
61
+ from openapi_client.api.test_job_api import TestJobApi as TestJobApi
62
+ from openapi_client.api.test_result_api import TestResultApi as TestResultApi
63
+
64
+ # import ApiClient
65
+ from openapi_client.api_response import ApiResponse as ApiResponse
66
+ from openapi_client.api_client import ApiClient as ApiClient
67
+ from openapi_client.configuration import Configuration as Configuration
68
+ from openapi_client.exceptions import OpenApiException as OpenApiException
69
+ from openapi_client.exceptions import ApiTypeError as ApiTypeError
70
+ from openapi_client.exceptions import ApiValueError as ApiValueError
71
+ from openapi_client.exceptions import ApiKeyError as ApiKeyError
72
+ from openapi_client.exceptions import ApiAttributeError as ApiAttributeError
73
+ from openapi_client.exceptions import ApiException as ApiException
74
+
75
+ # import models into sdk package
76
+ from openapi_client.models.device_under_test import DeviceUnderTest as DeviceUnderTest
77
+ from openapi_client.models.func_string_task_boolean import FuncStringTaskBoolean as FuncStringTaskBoolean
78
+ from openapi_client.models.product import Product as Product
79
+ from openapi_client.models.project import Project as Project
80
+ from openapi_client.models.release import Release as Release
81
+ from openapi_client.models.result_type import ResultType as ResultType
82
+ from openapi_client.models.script import Script as Script
83
+ from openapi_client.models.script_repository import ScriptRepository as ScriptRepository
84
+ from openapi_client.models.test_build import TestBuild as TestBuild
85
+ from openapi_client.models.test_case import TestCase as TestCase
86
+ from openapi_client.models.test_job import TestJob as TestJob
87
+ from openapi_client.models.test_job_parameter import TestJobParameter as TestJobParameter
88
+ from openapi_client.models.test_job_report_template import TestJobReportTemplate as TestJobReportTemplate
89
+ from openapi_client.models.test_machine import TestMachine as TestMachine
90
+ from openapi_client.models.test_plan import TestPlan as TestPlan
91
+ from openapi_client.models.test_plan_recipe import TestPlanRecipe as TestPlanRecipe
92
+ from openapi_client.models.test_report import TestReport as TestReport
93
+ from openapi_client.models.test_result import TestResult as TestResult
94
+ from openapi_client.models.test_suite import TestSuite as TestSuite
95
+ from openapi_client.models.user_credential import UserCredential as UserCredential
96
+
@@ -0,0 +1,9 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from openapi_client.api.dashboard_api import DashboardApi
5
+ from openapi_client.api.project_api import ProjectApi
6
+ from openapi_client.api.test_build_api import TestBuildApi
7
+ from openapi_client.api.test_job_api import TestJobApi
8
+ from openapi_client.api.test_result_api import TestResultApi
9
+