Skip to content

Variable

Contains blocks to access job variables.

count(job__)

Counts the variables.

create(job__, *, name)

Creates a new blank variable, if variable is already exists, raises an error.

Parameters:

Name Type Description Default
name str

Name of the variable.

required

delete(job__, *, name, silent=True)

Deletes the variable by its name. Raises an error if silent flag is set to False and variable doesn't exists.

Parameters:

Name Type Description Default
name str

Name of the variable.

required
silent bool

Raises an error if silent flag is set to False and variable doesn't exists.

True

get(job__, *, name, default=Empty)

Gets the variable by its name. Raises an error if default value hasn't provided and variable doesn't exists.

Parameters:

Name Type Description Default
name str

Name of the variable.

required
default Any

If provided, returns it if variable is not found. If not provided, raises an error if variable doesn't exists.

Empty

is_exists(job__, *, name)

Checks if variable exists.

Parameters:

Name Type Description Default
name str

Name of the variable.

required

list_names(job__)

Lists the variable names.

list_values(job__)

Lists the variable values.

set_(job__, *, name, value=None)

Sets a value to variable. If variable doesn't exists, creates new one.

Parameters:

Name Type Description Default
name str

Name of the variable.

required
value Any

Value of the variable.

None