Skip to content

Scripts

Each script does one thing and stands on its own: copy it, save it, run it.

How to use a script

  1. Copy the script into a new file and save it with the name shown above it, for example create_job.py. Your project folder is fine.
  2. Edit the lines marked # <- change this, if there are any. Only the upload scripts have them: your zip, its data type, and the task sentence.
  3. Run it from a terminal where the SDK is installed (Install) and your key is loaded (API key):

    python create_job.py
    

    Scripts that work on an existing job take the job id after the file name:

    python check_status.py qcjob_yLrQuj9XZ2LxIBbVN6f8S2
    

All scripts

Script What it does Run it as
Create a job Upload, grade, wait, save the PDF, all in one go python create_job.py
Upload only Send a zip without grading it yet python upload_only.py
Grade an upload Start grading an earlier upload python grade_job.py <job id>
Check status See where a job is, once python check_status.py <job id>
Wait until finished Follow a job until it ends python wait_for_job.py <job id>
Get the report & PDF Print the results and save the PDF python get_report.py <job id>
Share in a browser A token to open the report in a browser python report_access.py <job id>
Cancel a job Stop a job before grading starts python cancel_job.py <job id>
List your jobs Your recent jobs, newest first python list_jobs.py

A typical session

python create_job.py                       # upload + grade + wait + PDF

If you stop it while it waits (Ctrl+C), pick the job up later:

python wait_for_job.py qcjob_...
python get_report.py qcjob_...
python upload_only.py                      # prints the job id
python grade_job.py qcjob_...              # within 24 hours
python wait_for_job.py qcjob_...
python get_report.py qcjob_...

The four lines every script starts with

import os
from centific import PhysicalAI

client = PhysicalAI(
    api_key  = os.environ["CENTIFIC_API_KEY"],       # loaded from your terminal
    base_url = "https://humanoidiq-dev.centific.com", # the beta server
)

Copying a script from the dashboard's API tab? Make two changes

  1. base_url: the samples show the final release address, https://api.centific.ai. For this beta, change it to https://humanoidiq-dev.centific.com.
  2. api_key: right after you create a key, the samples contain your real key. Keep that file private, or better, replace it with os.environ["CENTIFIC_API_KEY"] as above. At other times the sample shows the text "$CENTIFIC_API_KEY". Python does not read that as your key, so replace it the same way.

About the sample outputs

Each script page shows the format the script prints. Ids, sizes, times, verdicts and scores are examples; yours will differ.