Python client for prism.web.service
Project description
Prism Python Client
Python helper for uploading benchmark and test artifacts to a Prism server.
This README is intentionally focused on prism_client.py usage and examples.
Requirements
- Python 3.10+
Install
From this folder:
pip install -r requirements.txt
Optional editable install:
pip install -e .
What prism_client.py Uploads
The script can upload four metadata types:
result: test result payload toPOST /TestResult/AddResult/env: environment payload toPOST /TestResult/AddEnvirnoment/param: parameter payload toPOST /TestResult/AddParameter/meta: metadata payload toPOST /TestResult/AddMetadata/
host should include the API prefix, for example https://localhost:44303/api/v1.
CLI Usage
python prism_client.py host -t TEST_JOB -p PROJECT -m {env,meta,param,result} -n NAME (-j JSON | -c CSV) [options]
Required arguments:
host: Prism server API root URL-t, --test-job: test job name-p, --project: project name-m, --meta-type: one ofenv,meta,param,result-n, --name: unique label (dataInfo) for the uploaded payload- one of
-j, --jsonor-c, --csv
Optional arguments:
-g, --build-guid: build GUID (auto-generated if omitted)-s, --start: start time (ISO string, defaults to current time)-e, --end: end time (ISO string, defaults to current time)-x, --timeout-hours: timeout in hours (default0)-b, --build-result: one ofNotExecuted|Pass|Fail|Blocked|InProgress|Hang|Paused|Aborted-r, --test-result: one ofNotExecuted|Pass|Fail|Blocked|InProgress|Hang|Paused|Aborted
Example: Upload Test Result From JSON
Create result.json:
{
"summary": {
"throughput": 1234,
"latency_ms": 21.4,
"passed": true
},
"details": [
{
"name": "case_001",
"status": "Pass",
"duration_ms": 120
}
]
}
Run:
python prism_client.py https://your-prism-server/api/v1 \
-p YourProject \
-t YourTestJob \
-m result \
-n benchmark-run-20260609 \
-j result.json \
-b Pass \
-r Pass
Example: Upload Test Result From CSV
If you provide CSV, the script converts it to JSON before upload.
python prism_client.py https://your-prism-server/api/v1 \
-p YourProject \
-t YourTestJob \
-m result \
-n benchmark-run-csv \
-c result.csv \
-b Pass \
-r Pass
Example: Upload Environment / Parameter / Metadata
Environment:
python prism_client.py https://your-prism-server/api/v1 \
-p YourProject \
-t YourTestJob \
-m env \
-n hw-sw-info \
-j environment.json
Parameter:
python prism_client.py https://your-prism-server/api/v1 \
-p YourProject \
-t YourTestJob \
-m param \
-n runtime-args \
-j parameters.json
Metadata:
python prism_client.py https://your-prism-server/api/v1 \
-p YourProject \
-t YourTestJob \
-m meta \
-n build-info \
-j metadata.json
Python API Example (Using prism_client.py Functions)
import json
import uuid
from datetime import datetime, timezone
from prism_client import upload_result
host = "https://your-prism-server/api/v1"
project = "YourProject"
test_job = "YourTestJob"
name = "benchmark-run-20260609"
with open("result.json", "r", encoding="utf-8") as f:
payload = json.load(f)
upload_result(
host=host,
project=project,
test_job=test_job,
name=name,
data=payload,
build_guid=str(uuid.uuid4()),
build_result="Pass",
test_result="Pass",
start=datetime.now(timezone.utc).isoformat(),
end=datetime.now(timezone.utc).isoformat(),
timeout_hours=0,
)
Run Tests
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prism_py_client-1.0.1.tar.gz.
File metadata
- Download URL: prism_py_client-1.0.1.tar.gz
- Upload date:
- Size: 82.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a50c84b5272ea49ae75a674a802833135978cf6fcced33f5ffd8706a67a83b8
|
|
| MD5 |
be2c2a474a073ece27516956de4d5711
|
|
| BLAKE2b-256 |
48cfc8cb33922d0c0f6fb0f71c8233128819d808ade315766d1260b66b1c1ac8
|
Provenance
The following attestation bundles were made for prism_py_client-1.0.1.tar.gz:
Publisher:
python-publish.yml on shangerxin/prism.client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prism_py_client-1.0.1.tar.gz -
Subject digest:
6a50c84b5272ea49ae75a674a802833135978cf6fcced33f5ffd8706a67a83b8 - Sigstore transparency entry: 2054273769
- Sigstore integration time:
-
Permalink:
shangerxin/prism.client@0004e4d50609f7296e41297aa22ceb5f1aac1417 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/shangerxin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0004e4d50609f7296e41297aa22ceb5f1aac1417 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file prism_py_client-1.0.1-py3-none-any.whl.
File metadata
- Download URL: prism_py_client-1.0.1-py3-none-any.whl
- Upload date:
- Size: 77.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
deb187e319d93b328137e28895728636f96a62c03f75e1cfce7acb8179a488b9
|
|
| MD5 |
0275db04b67f36ff827a69e63c3ae68e
|
|
| BLAKE2b-256 |
45c44c6d55eae6fd12cfd2041521e33be724d0c683f07bfa87f1906b92382221
|
Provenance
The following attestation bundles were made for prism_py_client-1.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on shangerxin/prism.client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prism_py_client-1.0.1-py3-none-any.whl -
Subject digest:
deb187e319d93b328137e28895728636f96a62c03f75e1cfce7acb8179a488b9 - Sigstore transparency entry: 2054274091
- Sigstore integration time:
-
Permalink:
shangerxin/prism.client@0004e4d50609f7296e41297aa22ceb5f1aac1417 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/shangerxin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0004e4d50609f7296e41297aa22ceb5f1aac1417 -
Trigger Event:
workflow_dispatch
-
Statement type: