openprotein.jobs#

Retrieve and monitor your jobs on our platform.

Interface#

class openprotein.jobs.JobsAPI(session)[source]#

API interface to get jobs.

list(status=None, job_type=None, assay_id=None, more_recent_than=None, limit=100)[source]#

List jobs.

get(job_id, verbose=False)[source]#

Get job by ID.

Notes

This retrieves the job and loads it as a future so you can do wait and get.

wait(future, interval=5, timeout=None, verbose=False)[source]#

Waits on a job result.

Classes#

class openprotein.jobs.Job(*, job_id, job_type, status, created_date, start_date=None, end_date=None, prerequisite_job_id=None, progress_message=None, progress_counter=None, sequence_length=None, **extra_data)[source]#
class openprotein.jobs.Future(session, job)[source]#

Base class for all Futures returning results from a job.

done()[source]#

Check if the job has completed.

Returns:

True if the job is done, False otherwise.

Return type:

bool

refresh()[source]#

Refresh the job status and internal job object.

abstractmethod get(verbose=False, **kwargs)[source]#

Return the results from this job.

Parameters:
  • verbose (bool, optional) – Flag to enable verbose output, by default False.

  • **kwargs – Additional keyword arguments.

wait_until_done(interval=5, timeout=None, verbose=False)[source]#

Wait for the job to complete.

Parameters:
  • interval (float, optional) – Time in seconds between polling. Defaults to config.POLLING_INTERVAL.

  • timeout (int, optional) – Maximum time in seconds to wait. Defaults to None.

  • verbose (bool, optional) – Verbosity flag. Defaults to False.

Returns:

True if the job completed successfully.

Return type:

bool

Notes

This method does not fetch the job results, unlike wait().

wait(interval=5, timeout=None, verbose=False)[source]#

Wait for the job to complete, then fetch results.

Parameters:
  • interval (int, optional) – Time in seconds between polling. Defaults to config.POLLING_INTERVAL.

  • timeout (int | None, optional) – Maximum time in seconds to wait. Defaults to None.

  • verbose (bool, optional) – Verbosity flag. Defaults to False.

Returns:

The results of the job.

Return type:

Any