Retrieve the status and progress of a batch processing job.
Parameters
batch_id: str
The batch ID to retrieve
Returns
Get batch status
import os
from safetykit import Safetykit
client = Safetykit(
api_key=os.environ.get("SAFETYKIT_API_KEY"), # This is the default and can be omitted
)
batch = client.batches.get(
"batch_id",
)
print(batch.batch_id)
{
"batch_count": 2000,
"batch_id": "batch_01hf89meedvef6pc00njv3ezh0",
"batch_status": "SUCCESS",
"cancelled_count": 0,
"download_url": "https://safetykit-batch-downloads-production.s3.us-west-2.amazonaws.com/...",
"error_count": 0,
"pending_count": 540,
"success_count": 1460,
"upload_url": null,
"policy_id": "",
"policy_version": ""
}
Returns Examples
{
"batch_count": 2000,
"batch_id": "batch_01hf89meedvef6pc00njv3ezh0",
"batch_status": "SUCCESS",
"cancelled_count": 0,
"download_url": "https://safetykit-batch-downloads-production.s3.us-west-2.amazonaws.com/...",
"error_count": 0,
"pending_count": 540,
"success_count": 1460,
"upload_url": null,
"policy_id": "",
"policy_version": ""
}