qat.core.Batch

class qat.core.Batch(jobs=None, meta_data=None)

Simple higher level wrapper for the serializable Batch class.

Instance attributes:
  • jobs (list<Job>): jobs composing the batch

  • meta_data (dict<str, str>): meta data

dump(fname)

Dumps the Qaptiva object in a binary file

Warning

The filename name can be extended to have extension ".batch"

Parameters:

fname (str) – the file name

property file_extension: str

Read-only property returning the file extension used by dump()

classmethod from_bytes(data: bytes)

Builds a batch from raw bytes object

classmethod from_thrift(tobject)

Builds a Batch object from a thrift batch

get_variables()

Returns the sorted list of all variables appearing in the Batch.

classmethod load(fname)

Loads a Qaptiva object from a binary file

Warning

The filename name can be extended to have an extension

Parameters:

fname (str) – the file name

Returns:

An instance of the loaded object

to_cpp()

Cast the Batch into a Thrift object not meant for serialized transmission, but rather for C++ code.

to_thrift()

Cast the Batch into a pure Thrift object