Skip to main content

bsub.io API

Project description

bsubio-python (beta)

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!

Quick Start

Installation

pip install bsubio

That's it! No infrastructure to configure, no servers to manage.

Basic Usage

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.

How It Works

bsub.io handles the heavy lifting:

  1. Create a job with POST /v1/jobs — get back a job ID and upload token
  2. Upload your data with POST /v1/upload/{jobId} — send files for processing
  3. Submit for processing with POST /v1/jobs/{jobId}/submit — kick off the work
  4. Monitor status with GET /v1/jobs/{jobId} — track progress
  5. Retrieve results with GET /v1/jobs/{jobId}/output — get your output

Job States

Your job progresses through these states:

  • created → Job created, awaiting upload
  • loaded → Data uploaded successfully
  • pending → Waiting in queue
  • processing → Work in progress
  • finished → All done!
  • failed → Something went wrong (check logs)

Authentication

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"
)

Requirements

  • Python 3.9+
  • That's it!

API Reference

All URIs are relative to https://app.bsub.io

Endpoints

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

Models

Additional Info

Generated SDK

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

Development

Want to run tests?

pytest

Alternative installation from source:

pip install git+https://github.com/bsubio/bsubio-python.git

Get Help

Author

Adam Koszek Email: contact@bsub.io Web: bsub.io

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

bsubio-0.0.6.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bsubio-0.0.6-py3-none-any.whl (61.6 kB view details)

Uploaded Python 3

File details

Details for the file bsubio-0.0.6.tar.gz.

File metadata

  • Download URL: bsubio-0.0.6.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for bsubio-0.0.6.tar.gz
Algorithm Hash digest
SHA256 df872803d52c3555b3f207337542ccd264bcbe7fc3fbca5dce51ab3698ea41d6
MD5 2abe7eaa5fdc6b66131b82759ce4ac03
BLAKE2b-256 50954d7192df81743fe354dacae2cfbf0c400437ec5e3984118ccb7f46a270e8

See more details on using hashes here.

File details

Details for the file bsubio-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: bsubio-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 61.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for bsubio-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f26389c6e7d3161b7813cab754796bee07fa7d069741f5e1ea6c162c52529f1e
MD5 181abd56e1e8d09a0b4ffa55f19ed2fe
BLAKE2b-256 fd67d1e69aa80ce19749afe9a12ed2679f1d8a1c269d3df844fb295684060e22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page