Benchmarking API¶
The Benchmarking API runs evaluation jobs for xlsx workbooks.
Use unique_sdk.Benchmarking to:
- upload an input workbook,
- check run status,
- download the processed result workbook,
- download the starter template workbook.
Methods¶
unique_sdk.Benchmarking.process_upload - Upload benchmarking workbook
Upload an xlsx file for benchmarking processing.
Parameters:
user_id(str, required) - User identifiercompany_id(str, required) - Company identifierfile(bytes, required) - Workbook bytesfilename(str, required) - Uploaded file name (for examplebenchmark.xlsx)force(bool, optional) - If set, requests replacement/re-queue where supported by the backend
Returns:
Benchmarking.ProcessUploadResponsewithbenchmarkStatus(done,error,total)
Example:
import unique_sdk
with open("benchmark.xlsx", "rb") as f:
data = f.read()
uploaded = unique_sdk.Benchmarking.process_upload(
user_id=user_id,
company_id=company_id,
file=data,
filename="benchmark.xlsx",
force=True,
)
print(uploaded)
unique_sdk.Benchmarking.get_status - Read benchmarking status
Read the current status snapshot for the company.
Parameters:
user_id(str, required) - User identifiercompany_id(str, required) - Company identifier
Returns:
Benchmarking.StatusSnapshotwith fields such asdone,error,total,filename,status
Example:
status = unique_sdk.Benchmarking.get_status(
user_id=user_id,
company_id=company_id,
)
print(status)
unique_sdk.Benchmarking.download_processed - Download processed workbook
Download the generated result workbook to a temporary file path.
Parameters:
user_id(str, required) - User identifiercompany_id(str, required) - Company identifierfilename(str, optional) - Local output filename (default:benchmarking_result.xlsx)
Returns:
pathlib.Pathto the downloaded file
Example:
result_path = unique_sdk.Benchmarking.download_processed(
user_id=user_id,
company_id=company_id,
)
print(result_path)
unique_sdk.Benchmarking.download_template - Download template workbook
Download the input template workbook to a temporary file path.
Parameters:
user_id(str, required) - User identifiercompany_id(str, required) - Company identifierfilename(str, optional) - Local output filename (default:benchmarking_template.xlsx)
Returns:
pathlib.Pathto the downloaded file
Example:
template_path = unique_sdk.Benchmarking.download_template(
user_id=user_id,
company_id=company_id,
)
print(template_path)
Async variants¶
Every method also has an async counterpart:
process_upload_asyncget_status_asyncdownload_processed_asyncdownload_template_async
Utility helper¶
For end-to-end flow from local path (upload, poll until done, optional save), use Benchmarking run utility.