PrismaX Python SDK for data uploads
Project description
PrismaX Python SDK
Minimal upload SDK for PrismaX data uploads.
License
This SDK is source-available for noncommercial use under the PolyForm Noncommercial License 1.0.0. Commercial use is not permitted unless PrismaX grants a separate commercial license.
Quickstart
You need:
- a PrismaX upload API key with the
pxu_prefix - a PrismaX task ID or task scenario/name
- the robot serial number for the machine that produced the data
Create and find these in the PrismaX app:
- App: https://app.prismax.ai
- Upload API key: open https://app.prismax.ai/account, go to API Keys, then create an Operator / Upload key. The key is shown once, so copy it when it is created.
- Task scenario/name: open https://app.prismax.ai/data/upload and use the
task card title, for example
Pick and place packaged food items. The SDK resolves this to the database task ID automatically using a case-insensitive match. - Task ID: if you already know the numeric database task ID, you can pass it directly instead of the scenario/name.
- Robot serial number: open https://app.prismax.ai/account and use the serial number for the registered operator machine that produced the data.
pip install prismax
export PRISMAX_API_KEY="pxu_your_upload_api_key"
Download API keys are not valid for uploads.
import prismax
result = prismax.upload(
"./data",
scenario="Pick and place packaged food items",
serial_number="robot_serial_number",
)
print(result["upload_id"])
The SDK scans the folder, creates an upload session, uploads raw files to signed Google Cloud URLs, generates episode manifests in memory, uploads manifests last, and returns the upload summary.
You can also pass the API key directly:
import prismax
result = prismax.upload(
"./data",
scenario="Pick and place packaged food items",
serial_number="robot_serial_number",
api_key="pxu_your_upload_api_key",
)
You can also pass task_id=123 instead of scenario=....
Expected Folder Structure
data/
1.mcap
1/
high.mp4
left.mp4
right.mp4
high2.mp4
left2.mp4
right2.mp4
Each episode must contain one root {episode}.mcap file and at least three MP4
files under {episode}/: one primary filename containing left, one containing
right, and one environment/high video filename containing neither. Additional
MP4 files are uploaded as raw files, included in downloads, and checked for
duration consistency. A duration mismatch across any episode videos can fail the
upload. Only the primary three videos are processed for derived previews, QA,
and duplicate detection.
Use lowercase .mp4 extensions. Uppercase variants such as .MP4 are rejected
so client validation, worker processing, and download manifests choose the same
primary videos. Hidden files are ignored, including macOS metadata files such as
.DS_Store and ._left.mp4.
Primary video selection is based on filename:
- filenames containing
leftare treated as left videos - filenames containing
rightare treated as right videos - other MP4 files are treated as environment/high videos
- exact names are preferred, for example
high.mp4,left.mp4, andright.mp4are selected beforehigh2.mp4,left2.mp4, andright2.mp4
Example:
data/
1.mcap
1/
high.mp4
left.mp4
right.mp4
high2.mp4
left2.mp4
right2.mp4
Primary videos:
env/high: high.mp4
left: left.mp4
right: right.mp4
Additional videos:
high2.mp4
left2.mp4
right2.mp4
CLI
prismax upload ./data --scenario "Pick and place packaged food items" --serial-number robot_serial_number
prismax status 123
Use --wait to wait for the worker to finish. The default maximum wait time is
30 minutes.
prismax upload ./data --scenario "Pick and place packaged food items" --serial-number robot_serial_number --wait
prismax upload ./data --scenario "Pick and place packaged food items" --serial-number robot_serial_number --wait --max-wait 3600
Useful CLI options:
prismax upload ./data --scenario "Pick and place packaged food items" --serial-number robot_serial_number --timeout 120 --retries 5
prismax upload ./data --scenario "Pick and place packaged food items" --serial-number robot_serial_number --wait --poll-interval 5 --max-poll-errors 3
Status and Resume
Status and resume require a PrismaX upload API key, either from
PRISMAX_API_KEY or the api_key= argument. Use an upload key with access to
the original upload; download API keys are not valid.
import prismax
upload_status = prismax.status(123)
resume_result = prismax.resume(
123,
"./data", # same original folder used for the upload
)
prismax status 123
prismax resume 123 ./data
Resume expects the same original complete upload folder/file list, not only the
files that are missing from cloud storage. Do not pass a folder that contains
only failed or remaining files. The SDK will ask the API which files still need
signed upload URLs. Resume is only allowed while the upload is still in
UPLOADING status; once processing has started or the upload reaches a
terminal status, create a new upload instead.
Error Handling
import prismax
try:
prismax.upload(
"./data",
scenario="Pick and place packaged food items",
serial_number="robot_serial_number",
)
except prismax.PrismaxValidationError as exc:
print(f"Invalid upload folder: {exc}")
except prismax.PrismaxAuthError as exc:
print(f"API key or permission error: {exc}")
except prismax.PrismaxApiError as exc:
print(f"PrismaX API error: {exc}")
If raw file upload fails after the session is created, the SDK error includes
the upload ID and a prismax resume <upload_id> <original_folder> command.
Project details
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 prismax-0.1.3.tar.gz.
File metadata
- Download URL: prismax-0.1.3.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6132747f89c80a6fd0b0f09637c4f112b330140b915928717a29fed322e54613
|
|
| MD5 |
acd0e03cfc47505ad5fbb2e846a11b5c
|
|
| BLAKE2b-256 |
645a67b57a2122c0848cbbb0bd4fa9861f148614ae4ed7750e67d130f9d8074e
|
File details
Details for the file prismax-0.1.3-py3-none-any.whl.
File metadata
- Download URL: prismax-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0204d49c68945a452bf040242611480a722b59c9e4353a38e857cbc4ee3556b0
|
|
| MD5 |
becf2231378a6c9163f7937b04067861
|
|
| BLAKE2b-256 |
11c2ba5f1697c6a7be5d45f0ec1a12fd886885e51b0fb9335d499ded4703fa69
|