Python SDK for bsub.io — zero-setup batch execution for compute-intensive workloads.
No infrastructure management. No setup headaches. Just submit your files and retrieve results.
Perfect for:
- 📄 PDF extraction — pull text and data from documents
- 🎬 Video transcoding — convert media formats at scale
- 🎤 Audio transcription — speech to text
- 🖼️ Image processing — resize, convert, optimize
- ...and any other compute-heavy tasks you can throw at it!
pip install bsubioThat's it! No infrastructure to configure, no servers to manage.
import os
import bsubio
# Configure with your API key (grab it from https://app.bsub.io)
config = bsubio.Configuration(
access_token=os.environ["BSUB_API_KEY"]
)
# Create a client and start submitting jobs!
with bsubio.ApiClient(config) as client:
jobs_api = bsubio.JobsApi(client)
# Create a job
job = jobs_api.create_job({
"type": "pdf-extract",
"name": "Extract invoice data"
})
# Upload your file
jobs_api.upload_job_data(job.id, file=open("invoice.pdf", "rb"))
# Submit for processing
jobs_api.submit_job(job.id)
# Check status
status = jobs_api.get_job(job.id)
print(f"Job status: {status.state}")
# Get results when ready
if status.state == "finished":
output = jobs_api.get_job_output(job.id)
print(output)That's the entire workflow. Create → Upload → Submit → Retrieve. No queues to manage, no workers to provision.
bsub.io handles the heavy lifting:
- Create a job with
POST /v1/jobs— get back a job ID and upload token - Upload your data with
POST /v1/upload/{jobId}— send files for processing - Submit for processing with
POST /v1/jobs/{jobId}/submit— kick off the work - Monitor status with
GET /v1/jobs/{jobId}— track progress - Retrieve results with
GET /v1/jobs/{jobId}/output— get your output
Your job progresses through these states:
created→ Job created, awaiting uploadloaded→ Data uploaded successfullypending→ Waiting in queueprocessing→ Work in progressfinished→ All done!failed→ Something went wrong (check logs)
Get your API key from the bsub.io dashboard and pass it as a Bearer token:
config = bsubio.Configuration(
access_token="your-api-key-here"
)- Python 3.9+
- That's it!
All URIs are relative to https://app.bsub.io
| Class | Method | HTTP request | Description |
|---|---|---|---|
| JobsApi | cancel_job | POST /v1/jobs/{jobId}/cancel | Cancel a job |
| JobsApi | create_job | POST /v1/jobs | Create a new job |
| JobsApi | delete_job | DELETE /v1/jobs/{jobId} | Delete a job |
| JobsApi | get_job | GET /v1/jobs/{jobId} | Get job details |
| JobsApi | list_jobs | GET /v1/jobs | List jobs |
| JobsApi | submit_job | POST /v1/jobs/{jobId}/submit | Submit job for processing |
| JobsApi | upload_job_data | POST /v1/upload/{jobId} | Upload data to a job |
| OutputApi | get_job_logs | GET /v1/jobs/{jobId}/logs | Get job logs (stderr) |
| OutputApi | get_job_output | GET /v1/jobs/{jobId}/output | Get job output (stdout) |
| SystemApi | get_types | GET /v1/types | Get available processing types |
| SystemApi | get_version | GET /v1/version | Get API version |
- CancelJob200Response
- CreateJob201Response
- CreateJobRequest
- Error
- GetTypes200Response
- GetVersion200Response
- Job
- ListJobs200Response
- ListJobs200ResponseData
- ProcessingType
- ProcessingTypeExample
- ProcessingTypeInput
- ProcessingTypeOutput
- SubmitJob200Response
- UploadJobData200Response
This Python SDK is automatically generated from the bsub.io OpenAPI spec using OpenAPI Generator.
- API version: 1.0.0
- Package version: 1.0.0
- Build package:
org.openapitools.codegen.languages.PythonClientCodegen
Want to run tests?
pytestAlternative installation from source:
pip install git+https://github.com/bsubio/bsubio-python.git- Documentation: https://bsub.io/docs
- API Reference: https://app.bsub.io/docs
- Issues: github.com/bsubio/bsubio-python/issues
Adam Koszek Email: contact@bsub.io Web: bsub.io