Skip to content

Logic

Contains blocks to work with conditions and logic values.

assert_(*, value)

Raises an error if value is not truthy. Useful if you want to force the value to be truthy.

Parameters:

Name Type Description Default
value Any

The value that will be checked.

required

bitwise_and(*, value1, value2)

Performs bitwise AND operation.

Parameters:

Name Type Description Default
value1 Any

First value.

required
value2 Any

Second value.

required

bitwise_not(*, value)

Performs bitwise NOT operation.

Parameters:

Name Type Description Default
value Any

Any value.

required

bitwise_or(*, value1, value2)

Performs bitwise OR operation.

Parameters:

Name Type Description Default
value1 Any

First value.

required
value2 Any

Second value.

required

bool_(*, value)

Returns the value as bool.

Parameters:

Name Type Description Default
value Any

The value that will be converted to bool.

required

false()

Returns logical False.

if_(*, value1, value2, operator)

Performs a classic "IF" condition and returns the result.

Parameters:

Name Type Description Default
value1 Any

Left side of the operator.

required
value2 Any

Right side of the operator.

required
operator LogicalOperators

One of conditional operators.

"=" (equals), 
"!=" (not equals), 
">" (greater than), 
">=" (greater than or equal)
"<" (less than)
"<=" (less than or equal)
"is" (is)
"is not" (is not)

required

if_assert(*, value1, value2, operator)

Performs a classic "IF" condition. And raises an error if check is False. Useful if you want to terminate the workflow when the condition results with False.

Parameters:

Name Type Description Default
value1 Any

Left side of the operator.

required
value2 Any

Right side of the operator.

required
operator LogicalOperators

One of conditional operators.

"=" (equals), 
"!=" (not equals), 
">" (greater than), 
">=" (greater than or equal)
"<" (less than)
"<=" (less than or equal)
"is" (is)
"is not" (is not)

required

if_then_else(*, value, then, otherwise)

Checks if value is a truthy value or not. If it is a truthy value, then it returns then parameter, otherwise it returns the otherwise parameter.

Parameters:

Name Type Description Default
value Any

Any value.

required
then Any

The value that will return if value is truthy.

required
otherwise Any

The value that will return if value is not truthy.

required

is_none(*, value)

Checks if value is equals to None.

Parameters:

Name Type Description Default
value Any

Any value.

required

is_truth(*, value)

Checks if value is truthy.

A truthy value is a value that translates to "true" when evaluated in a boolean context. Empty sequences, collections and numeric values that are zero (0) means a falsy value.

Parameters:

Name Type Description Default
value Any

Any value.

required

logical_and(*, value1, value2)

Performs logical AND operation, returns true if all inputs are true, otherwise it returns false.

Parameters:

Name Type Description Default
value1 Any

First value.

required
value2 Any

Second value.

required

logical_not(*, value)

Performs logical negation, returning false if the input is true, and true if the input is false.

Parameters:

Name Type Description Default
value Any

Any value.

required

logical_or(*, value1, value2)

Performs logical OR operation, returns true if one of the inputs are true, if all inputs are false, then it returns false.

Parameters:

Name Type Description Default
value1 Any

First value.

required
value2 Any

Second value.

required

none()

Returns None.

not_assert(*, value)

Raises an error if value is truthy. Useful if you want to force the value to be not truthy.

Parameters:

Name Type Description Default
value Any

The value that will be checked.

required

true()

Returns logical True.