Skip to main content

bsub.io API

Project description

bsubio - Python SDK for bsub.io

REST API for batch processing compute-intensive workloads.

Submit jobs, upload data, and retrieve results through a simple API. Perfect for PDF processing, video transcoding, audio transcription, and more.

Authentication

All endpoints require Bearer token authentication using your API key:

Authorization: Bearer <your-api-key>

Get your API key from the Dashboard.

Job Lifecycle

  1. Create a job with POST /v1/jobs - Returns job ID and upload token
  2. Upload data with POST /v1/upload/{jobId} - Uses upload token
  3. Submit for processing with POST /v1/jobs/{jobId}/submit
  4. Monitor status with GET /v1/jobs/{jobId}
  5. Retrieve output with GET /v1/jobs/{jobId}/output

Job States

  • created - Job created, awaiting data upload
  • loaded - Data uploaded successfully
  • pending - Waiting in queue for a worker
  • claimed - Worker claimed the job
  • preparing - Worker preparing to process
  • processing - Processing started
  • finished - Processing completed successfully
  • failed - Processing failed with error

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Generator version: 7.17.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://bsub.io

Requirements.

Python 3.9+

Installation & Usage

pip install

Install from PyPI:

pip install bsubio

(or from source: pip install git+https://github.com/bsubio/bsubio-python.git)

Then import the package:

import bsubio

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import bsubio

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import os
import bsubio
from bsubio.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.bsub.io
# See configuration.py for a list of all supported configuration parameters.
configuration = bsubio.Configuration(
    host = "https://app.bsub.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (API Key): BearerAuth
configuration = bsubio.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with bsubio.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = bsubio.JobsApi(api_client)
    job_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' # str | Unique job identifier (UUID)

    try:
        # Cancel a job
        api_response = api_instance.cancel_job(job_id)
        print("The response of JobsApi->cancel_job:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobsApi->cancel_job: %s\n" % e)

Documentation for API Endpoints

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

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: Bearer authentication (API Key)

Author

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.3.tar.gz (37.8 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.3-py3-none-any.whl (61.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bsubio-0.0.3.tar.gz
  • Upload date:
  • Size: 37.8 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.3.tar.gz
Algorithm Hash digest
SHA256 3c4097a0d5b95218d6b41f42a54fd444f87339c4cbd38595b7f9daebd631aea9
MD5 6ed8e9508813c764cd1ccf44f83c4609
BLAKE2b-256 a5353a8d89d048c6806df0e360bb1db3700e6afb85ef662516f32281a0ddc832

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bsubio-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 61.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0e6c217da8662146097e918bd7487f575f9652f9342c9f7fa5e7673fef980c7a
MD5 95b10fda413688a88f7673630300b372
BLAKE2b-256 765e793032a9a1c3d4926046c278b7006d29ac97376efc7bb1f2e8435379533b

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