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.5.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.5-py3-none-any.whl (61.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bsubio-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 2b0540135ee81c8920a7c685d74470dfc6e7c511b6182275e0f9074259531039
MD5 3aa19872efbbfc7872b9e82d250b4093
BLAKE2b-256 5eccb1661269eb10bb5478c04c80a5bcc98d28e52dd857d7ff396ed1511976e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bsubio-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1b0fb137be64f60ec6e64dc0fd77996250a48a4a2fd3508a7ce7a31ae8533410
MD5 ccff3024b52ef999f979ad1acc9c6d6b
BLAKE2b-256 3c92011fa63e249f052002515545f29dc5d751dab92856b4a288f5070fff9d5a

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