engine

emtellisplit_sdk_python.engine

Module Contents

Classes

NameDescription
DeferredResultA class that mimics asyncio.Future but it not awaitable. The caller is responsible for polling until done.
ResultFutureA class that mimics asyncio.Future
EmtellisplitThis is the primary way of interacting with an emtelliSplit server. It handles all the details for submitting documents, checking on the processing status, waiting for processing to finish.

Functions

NameDescription

Data

logger

API

emtellisplit_sdk_python.engine.logger

emtellisplit_sdk_python.engine.logger

Value: getLogger(...)

emtellisplit_sdk_python.engine.DeferredResult

class emtellisplit_sdk_python.engine.DeferredResult(job_id, api, output_bucket_prefix)

A class that mimics asyncio.Future but it not awaitable. The caller is responsible for polling until done.

DeferredResult.cancel
cancel()

Cancel the processing job being represented by this ResultFuture.

DeferredResult.status
status()

Gets the status of the processing job represented by this ResultFuture, updates the status of this ResultFuture.

DeferredResult.done
done()
DeferredResult.result
result() -> Result

emtellisplit_sdk_python.engine.ResultFuture

class emtellisplit_sdk_python.engine.ResultFuture(job_id, api, output_bucket_prefix, interval=10)

Bases: emtellisplit_sdk_python.engine.DeferredResult

A class that mimics asyncio.Future

ResultFuture.cancel
cancel()

Cancel the task being represented by this ResultFuture. Cancels the polling thread if it has been started.

ResultFuture.__await__
__await__() -> Result

Allows this object to be awaited. e.g. result = await result_future

ResultFuture.result
result() -> Result

Another method that can be used to await for the result. e.g. result = await result_future.result()

emtellisplit_sdk_python.engine.Emtellisplit

class emtellisplit_sdk_python.engine.Emtellisplit(server_url, auth_session: emtellisplit_sdk_python.auth.AuthSession)

This is the primary way of interacting with an emtelliSplit server. It handles all the details for submitting documents, checking on the processing status, waiting for processing to finish.

Emtellisplit.submit
submit(input_document) -> emtellisplit_sdk_python.engine.DeferredResult

Submits a document for processing. Returns a DeferredResult object which can be interacted with to get the status of processing, or the result after processing has succeeded or failed.

Emtellisplit.process
process(input_document) -> emtellisplit_sdk_python.engine.ResultFuture

Submits a document for processing. Returns an awaitable ResultFuture object which can be awaited to get the result after processing has suceeded or failed.

Emtellisplit.status
status(job_id)

Gets the status of a submitted job.

Emtellisplit.cancel
cancel(job_id)

Cancels a submitted job.