ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK package

Submodules

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.alteryx_engine module

Mock alteryx engine class definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.alteryx_engine.AlteryxEngine[source]

Bases: object

Alteryx Engine mock.

static create_temp_file_name(extension: str = 'tmp', options: int = 0)str[source]

Create temp file.

decrypt_password(encrypted_password: str, mode: int)str[source]

Decrypt password.

Deprecated since version 1.0.3: This will be removed in 2.0.0. Use functions of provider’s dcm property instead

get_constant(tool_id: int, which: int)None[source]

Get constant.

get_init_var(tool_id: int, var_name: str)str[source]

Get initialization variable.

output_message(tool_id: int, status: int, message: str)int[source]

Output message.

output_tool_progress(tool_id: int, percent_progress: float)None[source]

Output tool progress.

pre_sort(incoming_connection_type: str, incoming_connection_name: str, sort_info: str)None[source]

Presort records.

xmsg(msg: str, *args: Iterable[str])str[source]

Translate a message string.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.constants module

SDK constants.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.constants.EngineMessageType[source]

Bases: object

Engine output message types.

error = 100
info = 102
warning = 101
class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.constants.FieldType[source]

Bases: object

SDK field types.

blob = 'blob'
bool = 'bool'
byte = 'byte'
date = 'date'
datetime = 'datetime'
double = 'double'
fixeddecimal = 'fixeddecimal'
float = 'float'
int16 = 'int16'
int32 = 'int32'
int64 = 'int64'
spatialobj = 'spatialobj'
string = 'string'
time = 'time'
v_string = 'v_string'
v_wstring = 'v_wstring'
wstring = 'wstring'
class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.constants.Status[source]

Bases: object

Status constants.

update_output_config_xml = 0

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field module

Mock field class definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field(name: str, type: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.constants.FieldType, size: int, scale: int, source: str, description: str)[source]

Bases: object

Field mock.

equal_type(other_field: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field)bool[source]

Check if another field has an equal type.

get_as_blob(**kwargs: Mapping) → Any[source]
get_as_bool(**kwargs: Mapping) → Any[source]
get_as_double(**kwargs: Mapping) → Any[source]
get_as_int32(**kwargs: Mapping) → Any[source]
get_as_int64(**kwargs: Mapping) → Any[source]
get_as_string(**kwargs: Mapping) → Any[source]
get_null(record_ref: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_ref.RecordRef)bool[source]

Check if the value of a field is null.

set_from_blob(record_creator: RecordCreator, value: bytes)None[source]

Set value of a field as a blob.

set_from_bool(record_creator: RecordCreator, value: bool)None[source]

Set value of a field as a boolean.

set_from_double(record_creator: RecordCreator, value: float)None[source]

Set value of a field as a double.

set_from_int32(record_creator: RecordCreator, value: int)None[source]

Set value of a field as an int32.

set_from_int64(record_creator: RecordCreator, value: int)None[source]

Set value of a field as an int64.

set_from_string(record_creator: RecordCreator, value: str)None[source]

Set value of a field as a string.

set_null(record_creator: RecordCreator)None[source]

Set value of a field to null.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.output_anchor module

Mock output anchor class definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.output_anchor.OutputAnchor[source]

Bases: object

Output anchor mock.

assert_close()None[source]

Assert the output anchor is closed.

close()None[source]

Close the output anchor.

init(record_info_out: RecordInfo, sort_info_xml: str = '')bool[source]

Initialize the output anchor with record metadata.

output_record_count(final: bool)None[source]

Output the record count to Designer.

push_record(record_ref: RecordRef, no_auto_close: bool = False)bool[source]

Push a record downstream.

update_progress(percent: float)None[source]

Update progress.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.output_anchor_manager module

Mock output anchor manager class definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.output_anchor_manager.OutputAnchorManager(output_anchor_map: Mapping[str, OutputAnchor])[source]

Bases: object

Output anchor manager mock.

get_output_anchor(output_connection_name: str) → Optional[OutputAnchor][source]

Get an output anchor by name.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_copier module

Mock record copier class definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_copier.RecordCopier(destination: RecordInfo, source: RecordInfo, suppress_size_only_conversion_errors: bool = False, decimal_separator: str = '.')[source]

Bases: object

Record copier mock.

add(destination_field_num: int, source_field_num: int)None[source]

Add a field to the record copier.

copy(destination: RecordCreator, source: RecordRef)None[source]

Copy a record to the destination format.

done_adding()None[source]

Signal that fields are done being added.

static set_dest_to_null(destination: RecordCreator)None[source]

Set destination to all null.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_creator module

Mock record creator class definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_creator.RecordCreator(record_info: RecordInfo)[source]

Bases: object

Record Creator mock.

finalize_record()ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_ref.RecordRef[source]

Finalize a record ref.

reset(var_data_size: int = 0)None[source]

Reset the creator.

set_field(name: str, value: Any)None[source]

Set a field in the underlying record ref.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_info module

Mock record info class definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_info.RecordInfo(alteryx_engine: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.alteryx_engine.AlteryxEngine)[source]

Bases: object

Record info mock.

add_field(field_name: str, field_type: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.constants.FieldType, size: int = 0, scale: int = 0, source: str = '', description: str = '')ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field[source]

Add a field to the record info.

add_field_from_xml(xml: str, name_prefix: str = '')ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field[source]

Add a field from an XML string definition.

clone()ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_info.RecordInfo[source]

Make a copy of the record info.

construct_record_creator()ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_creator.RecordCreator[source]

Create a new record creator.

equal_types(record_info: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_info.RecordInfo, allow_additional_fields: bool = False)bool[source]

Check if another record info object has equal types to this.

get_field_by_name(field_name: str, throw_error: bool = True) → Optional[ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field][source]

Get a field object by field name.

get_field_num(field_name: str, throw_error: bool = True)int[source]

Get the index of a field by name.

get_hash()int[source]

Get hash of this record info.

get_record_xml_meta_data(include_source: bool = True)str[source]

Get XML metadata string.

init_from_xml(xml: str, name_prefix: str = '')None[source]

Initialize this record info from an XML string.

rename_field_by_index(field_idx: int, new_name: str)ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field[source]

Rename a field by index.

rename_field_by_name(old_name: str, new_name: str)ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field[source]

Rename a field by name.

swap_field_names(field_1: int, field_2: int)None[source]

Swap two field names.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_ref module

Mock record ref class definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_ref.RecordRef(record_info: RecordInfo)[source]

Bases: object

Record ref mock.

get_field(name: str) → Any[source]

Get the value of a field.

set_field(name: str, value: Any)None[source]

Set a field to a value.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.tool module

Tool definition.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.tool.Tool(engine: AlteryxEngine, plugin_instance: Any)[source]

Bases: object

Instance of a tool in a workflow along with associated data structures.

ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.tool_execution_info module

Class definition for tool execution information.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.tool_execution_info.ToolExecutionInfo[source]

Bases: object

Tool execution info class.

add_error(error: str)None[source]

Add an error message to the info.

add_info(info: str)None[source]

Add an info message to the info.

add_warning(warning: str)None[source]

Add an warning message to the info.

set_output_workflow_xml(xml: str)None[source]

Track the output tool workflow XML.

Module contents

Mocks for testing.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.AlteryxEngine[source]

Bases: object

Alteryx Engine mock.

static create_temp_file_name(extension: str = 'tmp', options: int = 0)str[source]

Create temp file.

decrypt_password(encrypted_password: str, mode: int)str[source]

Decrypt password.

Deprecated since version 1.0.3: This will be removed in 2.0.0. Use functions of provider’s dcm property instead

get_constant(tool_id: int, which: int)None[source]

Get constant.

get_init_var(tool_id: int, var_name: str)str[source]

Get initialization variable.

output_message(tool_id: int, status: int, message: str)int[source]

Output message.

output_tool_progress(tool_id: int, percent_progress: float)None[source]

Output tool progress.

pre_sort(incoming_connection_type: str, incoming_connection_name: str, sort_info: str)None[source]

Presort records.

xmsg(msg: str, *args: Iterable[str])str[source]

Translate a message string.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.EngineMessageType[source]

Bases: object

Engine output message types.

error = 100
info = 102
warning = 101
class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.FieldType[source]

Bases: object

SDK field types.

blob = 'blob'
bool = 'bool'
byte = 'byte'
date = 'date'
datetime = 'datetime'
double = 'double'
fixeddecimal = 'fixeddecimal'
float = 'float'
int16 = 'int16'
int32 = 'int32'
int64 = 'int64'
spatialobj = 'spatialobj'
string = 'string'
time = 'time'
v_string = 'v_string'
v_wstring = 'v_wstring'
wstring = 'wstring'
class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.Status[source]

Bases: object

Status constants.

update_output_config_xml = 0
class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.Field(name: str, type: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.constants.FieldType, size: int, scale: int, source: str, description: str)[source]

Bases: object

Field mock.

equal_type(other_field: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field)bool[source]

Check if another field has an equal type.

get_as_blob(**kwargs: Mapping) → Any[source]
get_as_bool(**kwargs: Mapping) → Any[source]
get_as_double(**kwargs: Mapping) → Any[source]
get_as_int32(**kwargs: Mapping) → Any[source]
get_as_int64(**kwargs: Mapping) → Any[source]
get_as_string(**kwargs: Mapping) → Any[source]
get_null(record_ref: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_ref.RecordRef)bool[source]

Check if the value of a field is null.

set_from_blob(record_creator: RecordCreator, value: bytes)None[source]

Set value of a field as a blob.

set_from_bool(record_creator: RecordCreator, value: bool)None[source]

Set value of a field as a boolean.

set_from_double(record_creator: RecordCreator, value: float)None[source]

Set value of a field as a double.

set_from_int32(record_creator: RecordCreator, value: int)None[source]

Set value of a field as an int32.

set_from_int64(record_creator: RecordCreator, value: int)None[source]

Set value of a field as an int64.

set_from_string(record_creator: RecordCreator, value: str)None[source]

Set value of a field as a string.

set_null(record_creator: RecordCreator)None[source]

Set value of a field to null.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.RecordInfo(alteryx_engine: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.alteryx_engine.AlteryxEngine)[source]

Bases: object

Record info mock.

add_field(field_name: str, field_type: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.constants.FieldType, size: int = 0, scale: int = 0, source: str = '', description: str = '')ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field[source]

Add a field to the record info.

add_field_from_xml(xml: str, name_prefix: str = '')ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field[source]

Add a field from an XML string definition.

clone()ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_info.RecordInfo[source]

Make a copy of the record info.

construct_record_creator()ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_creator.RecordCreator[source]

Create a new record creator.

equal_types(record_info: ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_info.RecordInfo, allow_additional_fields: bool = False)bool[source]

Check if another record info object has equal types to this.

get_field_by_name(field_name: str, throw_error: bool = True) → Optional[ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field][source]

Get a field object by field name.

get_field_num(field_name: str, throw_error: bool = True)int[source]

Get the index of a field by name.

get_hash()int[source]

Get hash of this record info.

get_record_xml_meta_data(include_source: bool = True)str[source]

Get XML metadata string.

init_from_xml(xml: str, name_prefix: str = '')None[source]

Initialize this record info from an XML string.

rename_field_by_index(field_idx: int, new_name: str)ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field[source]

Rename a field by index.

rename_field_by_name(old_name: str, new_name: str)ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.field.Field[source]

Rename a field by name.

swap_field_names(field_1: int, field_2: int)None[source]

Swap two field names.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.RecordCopier(destination: RecordInfo, source: RecordInfo, suppress_size_only_conversion_errors: bool = False, decimal_separator: str = '.')[source]

Bases: object

Record copier mock.

add(destination_field_num: int, source_field_num: int)None[source]

Add a field to the record copier.

copy(destination: RecordCreator, source: RecordRef)None[source]

Copy a record to the destination format.

done_adding()None[source]

Signal that fields are done being added.

static set_dest_to_null(destination: RecordCreator)None[source]

Set destination to all null.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.RecordCreator(record_info: RecordInfo)[source]

Bases: object

Record Creator mock.

finalize_record()ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.record_ref.RecordRef[source]

Finalize a record ref.

reset(var_data_size: int = 0)None[source]

Reset the creator.

set_field(name: str, value: Any)None[source]

Set a field in the underlying record ref.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.RecordRef(record_info: RecordInfo)[source]

Bases: object

Record ref mock.

get_field(name: str) → Any[source]

Get the value of a field.

set_field(name: str, value: Any)None[source]

Set a field to a value.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.OutputAnchor[source]

Bases: object

Output anchor mock.

assert_close()None[source]

Assert the output anchor is closed.

close()None[source]

Close the output anchor.

init(record_info_out: RecordInfo, sort_info_xml: str = '')bool[source]

Initialize the output anchor with record metadata.

output_record_count(final: bool)None[source]

Output the record count to Designer.

push_record(record_ref: RecordRef, no_auto_close: bool = False)bool[source]

Push a record downstream.

update_progress(percent: float)None[source]

Update progress.

class ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK.OutputAnchorManager(output_anchor_map: Mapping[str, OutputAnchor])[source]

Bases: object

Output anchor manager mock.

get_output_anchor(output_connection_name: str) → Optional[OutputAnchor][source]

Get an output anchor by name.