Export Task

class labelbox.schema.export_task.BufferedJsonConverterOutput(json: Any)[source]

Bases: object

Output with the JSON object

class labelbox.schema.export_task.BufferedStream(ctx: _TaskContext)[source]

Bases: Generic[OutputT]

Streams data from a Reader.

start(stream_handler: Callable[[OutputT], None] | None = None) None[source]

Starts streaming the result data. Calls the stream_handler for each result.

class labelbox.schema.export_task.ExportTask(task: Task, is_export_v2: bool = False)[source]

Bases: object

An adapter class for working with task objects, providing extended functionality and convenient access to task-related information.

This class wraps a Task object, allowing you to interact with tasks of this type. It offers methods to retrieve task results, errors, and metadata, as well as properties for accessing task details such as UID, status, and creation time.

exception ExportTaskException[source]

Bases: Exception

Raised when the task is not ready yet.

property completion_percentage

Returns the completion percentage of the task.

property created_at

Returns the time the task was created.

property created_by

Returns the user who created the task.

property deleted

Returns whether the task is deleted.

property errors

Returns the errors of the task.

property errors_url

Returns the errors URL of the task.

get_buffered_stream(stream_type: StreamType = StreamType.RESULT) BufferedStream[source]

Returns the result of the task.

Parameters:

stream_type (StreamType, optional) – The type of stream to retrieve. Defaults to StreamType.RESULT.

Returns:

The buffered stream object.

Return type:

Stream

Raises:
static get_task(client, task_id)[source]

Returns the task with the given id.

get_total_file_size(stream_type: StreamType) int | None[source]

Returns the total file size for a specific task.

get_total_lines(stream_type: StreamType) int | None[source]

Returns the total file size for a specific task.

has_errors() bool[source]

Returns whether the task has errors.

has_result() bool[source]

Returns whether the task has a result.

property metadata

Returns the metadata of the task.

property name

Returns the name of the task.

property organization

Returns the organization of the task.

property result

Returns the result of the task.

property result_url

Returns the result URL of the task.

property status

Returns the status of the task.

property type

Returns the type of the task.

property uid

Returns the uid of the task.

property updated_at

Returns the last time the task was updated.

wait_till_done(timeout_seconds: int = 7200) None[source]

Waits until the task is done.

class labelbox.schema.export_task.StreamType(value)[source]

Bases: Enum

The type of the stream.