ayx_python_sdk.providers.e1_provider package

Subpackages

Submodules

ayx_python_sdk.providers.e1_provider.anchor_builder module

Alteryx tool configuration definition.

class ayx_python_sdk.providers.e1_provider.anchor_builder.AnchorBuilder(tool_config: Dict[str, Any], output_anchor_mgr: AlteryxPythonSDK.OutputAnchorManager)[source]

Bases: object

Anchor builder definition.

build_input_anchors() List[E1InputAnchorProxy][source]

Build the input anchors based on tool config settings.

build_output_anchors() List[E1OutputAnchorProxy][source]

Build the output anchors based on tool config settings.

output_anchor_mgr
tool_config

ayx_python_sdk.providers.e1_provider.cache_e1_sdk_import module

Get the E1 package.

ayx_python_sdk.providers.e1_provider.cache_e1_sdk_import.cache_e1_sdk_import() None[source]

Cache the import for the E1 SDK.

This is necessary in order to remove the dependency on the AlteryxPythonSDK package.

ayx_python_sdk.providers.e1_provider.connection_callback_strategy module

Connection callback strategy definitions.

class ayx_python_sdk.providers.e1_provider.connection_callback_strategy.ConnectionCallbackStrategy(plugin_proxy: E1PluginProxy)[source]

Bases: ABC

ABC for callback strategy.

abstract connection_closed_callback(**_: Any) None[source]

Run callback for connection closing.

connection_initialized_callback(connection: ConnectionInterface, **_: Any) None[source]

Run callback for connection initialization.

plugin_proxy
abstract record_received_callback(connection: ConnectionInterface, **_: Any) None[source]

Run callback for when a record is received.

update_progress_callback(**_: Any) None[source]

Update input progress percentage.

class ayx_python_sdk.providers.e1_provider.connection_callback_strategy.UpdateOnlyConnectionCallbackStrategy(plugin_proxy: E1PluginProxy)[source]

Bases: ConnectionCallbackStrategy

Callback strategy for update only runs.

connection_closed_callback(**_: Any) None[source]

Close all anchors.

plugin_proxy
record_received_callback(connection: ConnectionInterface, **_: Any) None[source]

Raise error since this should never be called in update only mode.

class ayx_python_sdk.providers.e1_provider.connection_callback_strategy.WorkflowRunConnectionCallbackStrategy(plugin_proxy: E1PluginProxy)[source]

Bases: ConnectionCallbackStrategy

Callback strategy for workflow runs.

connection_closed_callback(**_: Any) None[source]

Process any remaining records and finalize.

plugin_proxy
record_received_callback(connection: ConnectionInterface, **_: Any) None[source]

Process single records by batch size.

ayx_python_sdk.providers.e1_provider.connection_interface module

Connection class definitions.

class ayx_python_sdk.providers.e1_provider.connection_interface.ConnectionInterface(plugin_proxy: E1PluginProxy, connection_name: str, anchor: E1InputAnchorProxy)[source]

Bases: ObservableMixin

Connection interface definition.

add_record_container(container: BaseRecordContainer) None[source]

Add a new record container.

anchor
clear_records() None[source]

Clear all records for this connection’s containers.

ii_close() None[source]

Close the connection.

ii_init(record_info: AlteryxPythonSDK.RecordInfo) bool[source]

Initialize the connection.

ii_push_record(record: AlteryxPythonSDK.RecordRef) bool[source]

Receive a record.

ii_update_progress(d_percent: float) None[source]

Update progress of incoming data.

name
plugin_failed
plugin_failure_callback(**_: Any) None[source]

Set failed status from plugin.

plugin_proxy
progress_percentage
record_batch_size: Optional[int]
record_containers: List[BaseRecordContainer]
property record_info: Optional[AlteryxPythonSDK.RecordInfo]

Getter for record info.

status
class ayx_python_sdk.providers.e1_provider.connection_interface.ConnectionStatus(value)

Bases: IntEnum

An enumeration.

CLOSED = 4
CREATED = 1
INITIALIZED = 2
RECEIVING_RECORDS = 3

ayx_python_sdk.providers.e1_provider.e1_dcm module

E1 Provider: Proxy class for DCM API.

class ayx_python_sdk.providers.e1_provider.e1_dcm.E1ProviderDCM[source]

Bases: DcmBase

Class that wraps DCM API work.

free_write_lock(connection_id: str, role: str, secret_type: str, lock_id: str) None[source]

Free a lock obtained from a previous call to get_write_lock().

Parameters:
  • connection_id – string with UUID of connection

  • role – A role such as ?oauth?

  • secret_type – A secret type such as ?oauth_token?

  • lock_id – A lock_id acquired from a previous call to get_write_lock()

get_connection(connection_id: str) Dict[source]

Retrieve connection information including secrets by connection ID.

Parameters:

connection_id – string with UUID of connection

get_write_lock(connection_id: str, role: str, secret_type: str, expires_in: Optional[datetime]) Dict[source]

Attempt to acquire an exclusive write lock.

Parameters:
  • connection_id – string with UUID of connection

  • role – A role such as ?oauth?

  • secret_type – A secret type such as ?oauth_token?

  • expires_in – (Optional) A DateTime value in which to ask for the lock to be held for in milliseconds. Defaults to 0.

update_connection_secret(connection_id: str, lock_id: str, role: str, secret_type: str, value: str, expires_on: Optional[datetime], parameters: Optional[Dict[str, str]]) Dict[source]

Update a single secret for role and secret_type to value as well as the optional expires_on and parameters.

Parameters:
  • connection_id – A connection ID

  • lock_id – A lock ID acquired from get_write_lock()

  • role – A role such as ?oauth?

  • secret_type – A secret type such as ?oauth_token?

  • value – The new value to store for the secret

  • expires_on – (Optional) DateTime of expiration of this secret

  • parameters – Dict of parameter values for this secret (this is arbitrary user data stored as JSON)

ayx_python_sdk.providers.e1_provider.e1_environment module

Proxy Class for managing SDK Environment.

class ayx_python_sdk.providers.e1_provider.e1_environment.E1Environment(engine: AlteryxPythonSDK.AlteryxEngine, tool_id: int, plugin_proxy: E1PluginProxy)[source]

Bases: EnvironmentBase

Environment variables for Designer.

property alteryx_install_dir: Path

Get the Alteryx install directory.

Returns:

The Alteryx install directory as a Path object.

Return type:

Path

property alteryx_locale: Literal['en', 'it', 'fr', 'de', 'ja', 'es', 'pt', 'zh']

Retrieve the locale code from Alteryx Designer User Settings.

Returns:

The language/region that Alteryx is using to display messages.

Return type:

Locale

property designer_version: str

Return the version of Designer that is being used.

Returns:

A version in the format of 1.2.3.4

Return type:

str

get_settings_conf(keys: list, version_override: str = '') dict[source]

Parse xml to retrieve settings.

parse_settings_key_value(settings_str: str, line_delimiter: str = '\n', key_delimiter: str = '=') dict[source]

Extract a key value pair from an xml text entry set by Designer.

property proxy_configuration: dict

Retrieve proxy config from UserSettings.xml.

property tool_id: int

Get the current tool’s workflow ID.

Returns:

Tool’s ID (specified by developer).

Return type:

int

property update_mode: UpdateMode

Get the type of update running.

Returns:

Enumeration corresponding to the update mode that the workflow is running in.

Return type:

UpdateMode

property update_only: bool

Check if the engine is running in update-only mode.

Returns:

Boolean value that indicates if the engine is running in update only.

Return type:

bool

update_tool_config(new_config: dict) None[source]

Update the tool’s configuration.

Parameters:

new_config – The new configuration to set for the tool.

Return type:

None

property workflow_dir: Path

Get the directory for the currently-running workflow.

Returns:

The workflow directory as a Path object.

Return type:

Path

property workflow_id: str

Get the WorkflowRunGuid for the currently-running workflow.

Returns:

The workflow id.

Return type:

str

ayx_python_sdk.providers.e1_provider.e1_input_anchor module

Alteryx plugin input anchor definition.

class ayx_python_sdk.providers.e1_provider.e1_input_anchor.E1InputAnchor(input_anchor_proxy: E1InputAnchorProxy)[source]

Bases: InputAnchorBase

Input anchor to the tool.

property allow_multiple: bool

Get the status that indicates if multiple connections are allowed.

Returns:

Boolean value that indicates if multiple connections are allowed.

Return type:

bool

property connections: List[InputConnectionBase]

Get the anchor connections.

Returns:

List of all the connections associated with the anchor.

Return type:

List[InputConnectionBase]

property name: str

Get the name of the input anchor.

Returns:

The name of the input anchor.

Return type:

str

property optional: bool

Get the status that indicates if the input anchor is optional.

Returns:

Boolean value that indicates if input anchor is optional.

Return type:

bool

ayx_python_sdk.providers.e1_provider.e1_input_anchor_proxy module

Alteryx plugin input anchor definition.

class ayx_python_sdk.providers.e1_provider.e1_input_anchor_proxy.E1InputAnchorProxy(name: str, allow_multiple: bool, optional: bool)[source]

Bases: object

Input anchor to the tool.

allow_multiple
connections: List[ConnectionInterface]
name
optional

ayx_python_sdk.providers.e1_provider.e1_input_connection module

E1 SDK Input Connection class.

class ayx_python_sdk.providers.e1_provider.e1_input_connection.E1InputConnection(conn_interface: ConnectionInterface)[source]

Bases: InputConnectionBase

Class for managing Inputs in E1 SDK.

property anchor: E1InputAnchor

Get the anchor this input connection is associated with.

Returns:

The anchor this input connection is associated with.

Return type:

InputAnchorBase

property metadata: Optional[Metadata]

Get the connection metadata.

Returns:

The metadata associated with this input connection.

This returns None when accessed before the input connection has been opened, since the metadata isn’t known until that point.

Return type:

Metadata, optional

property name: str

Get the connection name.

Returns:

Name of the input connection.

Return type:

str

property progress: float

Get the progress percentage of records received on this input connection.

Returns:

The progress percentage of the connection.

Return type:

float

read() RecordPacket[source]

Read a record packet from the incoming connection.

Returns:

A record packet that contains the data received by this connection.

Return type:

RecordPacketBase

ayx_python_sdk.providers.e1_provider.e1_io module

Proxy Class for SDK IO.

class ayx_python_sdk.providers.e1_provider.e1_io.E1IO(engine: AlteryxPythonSDK.AlteryxEngine, tool_id: int)[source]

Bases: IoBase

Class that wraps all IO communication with Alteryx Designer.

create_temp_file(extension: str = 'tmp', options: int = 0) Path[source]

Create a temporary file managed by Alteryx Designer.

Parameters:
  • extension – The extension of the new file.

  • options

    Lifecycle management options for the temp file.

    0: A normal temp file. It is cleaned up by Designer when a Run completes.

    1: A temp file for a GUI element, like a browse, that the GUI is responsible for cleaning up.

    2: A temp file for a GUI element, like a browse, that the GUI is responsible for cleaning up. Additionally, the file name is not made to be unique. Use when the extension argument already contains a unique ID.

Returns:

Path to the new temp file.

Return type:

Path

decrypt_password(password: str) str[source]

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

error(error_msg: str) None[source]

Display an error message in the Alteryx Designer Results window.

Parameters:

error_msg – A string to show as an error in the Designer Results window.

info(info_msg: str) None[source]

Display an info message in the Alteryx Designer Results window.

Parameters:

info_msg – A string to show as an info message in the Designer Results window.

translate_msg(msg: str, *args: Any) str[source]

Translate a message to the current locale.

Deprecated since version 0.1.0a: translate_msg is not the recommended translation mechanism. Refer to the documentation on localization.

Parameters:
  • msg – A string to translate.

  • args – Arguments for string interpolation.

Returns:

The translated string.

Return type:

str

update_progress(percent: float) None[source]

Update tool progress.

Parameters:

percent – A number between 0 and 100 to indicate the progress percentage.

warn(warn_msg: str) None[source]

Display a warning message in the Alteryx Designer Results window.

Parameters:

warn_msg – A string to show as a warning in the Designer Results window.

ayx_python_sdk.providers.e1_provider.e1_output_anchor module

Alteryx plugin output anchor definition.

class ayx_python_sdk.providers.e1_provider.e1_output_anchor.E1OutputAnchor(output_anchor_proxy: E1OutputAnchorProxy, engine: AlteryxPythonSDK.AlteryxEngine)[source]

Bases: OutputAnchorBase

Output anchor definition.

property allow_multiple: bool

Get the status that indicates if multiple connections are allowed.

Returns:

Boolean value that indicates if multiple connections are allowed.

Return type:

bool

close() None[source]

Close the outgoing connection.

flush() None[source]

Flush the written records for this output connection.

property is_open: bool

Get status indicating if the anchor is open.

property metadata: Optional[Metadata]

Get the anchor metadata.

property name: str

Get the name of the output anchor.

Returns:

The name of the output anchor.

Return type:

str

property num_connections: int

Get the number of connections attached to the anchor.

Returns:

The number of downstream connections on this anchor.

Return type:

int

open(metadata: Metadata) None[source]

Open the output anchor.

Write the outgoing record metadata and open this connection for outgoing packets.

Parameters:

metadata – The metadata to set for this anchor.

property optional: bool

Get the status that indicates if the output anchor is optional.

Returns:

Boolean value that indicates if output anchor is optional.

Return type:

bool

update_progress(percent: float) None[source]

Update the progress on downstream connections.

Parameters:

percentage – The percentage to write to Designer, that indicates the progress of output on this anchor.

write(record_packet: RecordPacketBase) None[source]

Write a RecordPacket to the outgoing connection.

Parameters:

record_packet – The record packet to write to the output anchor.

class ayx_python_sdk.providers.e1_provider.e1_output_anchor.OutputAnchorStatus(value)[source]

Bases: Enum

Output anchor status enumeration.

CLOSED = 2
CREATED = 0
OPEN = 1
ayx_python_sdk.providers.e1_provider.e1_output_anchor.generate_records_from_df(df: pd.DataFrame, record_info: AlteryxPythonSDK.RecordInfo) Iterator[AlteryxPythonSDK.RecordCreator][source]

Generate record creators from a dataframe.

ayx_python_sdk.providers.e1_provider.e1_output_anchor_proxy module

Alteryx plugin output anchor definition.

class ayx_python_sdk.providers.e1_provider.e1_output_anchor_proxy.E1OutputAnchorProxy(name: str, allow_multiple: bool, optional: bool, output_anchor_mgr: AlteryxPythonSDK.OutputAnchorManager, record_info: Optional[AlteryxPythonSDK.RecordInfo] = None)[source]

Bases: object

Output anchor definition.

allow_multiple
close() None[source]

Close the output anchor.

engine_anchor_ref: AlteryxPythonSDK.OutputAnchor
name
num_connections: int
optional
push_metadata() None[source]

Push metadata to downstream tools.

push_records: Callable
property record_info: Optional[AlteryxPythonSDK.RecordInfo]

Getter for record info.

update_progress(percent: float) None[source]

Push the progress to downstream tools.

ayx_python_sdk.providers.e1_provider.e1_plugin_driver module

E1 SDK Driver Class.

class ayx_python_sdk.providers.e1_provider.e1_plugin_driver.E1PluginDriver(user_plugin_class: Type[Plugin], provider: ProviderBase)[source]

Bases: object

Wrapper around the plugin to expose only interfaces defined for a provider.

initialize_connection(connection: ConnectionInterface) None[source]

Initialize a connection.

initialize_plugin() None[source]

Initialize plugin.

on_complete() None[source]

Close plugin code after all records have finished streaming.

on_record_packet(connection: ConnectionInterface) None[source]

Handle the record packet received through the input connection.

ayx_python_sdk.providers.e1_provider.e1_plugin_proxy module

Base plugin definition.

class ayx_python_sdk.providers.e1_provider.e1_plugin_proxy.E1PluginProxy(tool_id: int, alteryx_engine: AlteryxPythonSDK.AlteryxEngine, output_anchor_mgr: AlteryxPythonSDK.OutputAnchorManager)[source]

Bases: ObservableMixin

Base plugin to inherit from.

property all_connections_closed: bool

Getter that indicates if all input connections are closed.

property all_connections_initialized: bool

Getter that indicates if all input connections are initialized.

property all_required_connections_connected: bool

Getter that indicates if all required connections are connected.

anchor_builder: Optional[AnchorBuilder]
property callback_strategy: ConnectionCallbackStrategy

Generate the callback strategy for the tool.

close_output_anchors() None[source]

Close connection for all output anchors.

configure_logger() None[source]

Configure the logger.

engine
property environment: E1Environment

Get the Environment object from this provider.

failure_occurred
get_input_anchor(input_anchor_name: str) E1InputAnchorProxy[source]

Get an input anchor by name.

get_output_anchor(output_anchor_name: str) E1OutputAnchorProxy[source]

Get an output anchor by name.

handle_plugin_error(e: Exception) None[source]

Log a plugin error to the log and a generic error to Designer.

initialized
input_anchors: List[E1InputAnchorProxy]
property io: E1IO

Get the IO object from this provider.

property log_directory: Path

Get the log directory.

property log_filepath: Path

Get the log filename.

property logger: Logger

Get logger.

output_anchors: List[E1OutputAnchorProxy]
pi_add_incoming_connection(anchor_name: str, connection_name: str) ConnectionInterface[source]

Add incoming connection to the tool from the engine.

pi_add_outgoing_connection(anchor_name: str) bool[source]

Register an outgoing connection from this tool.

pi_close(b_has_errors: bool) None[source]

pi_close is useless. Never use it.

pi_init(workflow_config_xml_string: str) None[source]

Plugin initialization from the engine.

pi_push_all_records(n_record_limit: int) bool[source]

Push all records when no inputs are connected.

plugin_driver: Optional[E1PluginDriver]
push_all_metadata() None[source]

Push all metadata for anchors.

raise_missing_inputs() NoReturn[source]

Send a missing incoming inputs error to Designer.

record_batch_size: Optional[int]
property required_input_anchors: List[E1InputAnchorProxy]

Get the list of required input anchors for this tool.

tool_config_loader
tool_id
property tool_name: str

Getter for the tool name.

update_sys_path() None[source]

Update the sys.path to fix SDK issues.

The sys.path must be updated to include: - The venv path - The tool directory

in order for inline imports to work due to base SDK sys.path manipulation issues.

user_plugin
user_plugin_class: Type[Plugin]
user_plugin_directory_name: str
workflow_config

ayx_python_sdk.providers.e1_provider.e1_provider module

E1 SDK Provider Class.

class ayx_python_sdk.providers.e1_provider.e1_provider.E1Provider(plugin_proxy: E1PluginProxy, workflow_config: WorkflowConfiguration)[source]

Bases: ProviderBase

Provides resources generated from the E1 Python SDK.

property dcm: E1DCM

Get the DCM object from this provider.

Returns:

An instance of a concrete Dcm object.

Return type:

Dcm

property environment: E1Environment

Get the Environment object from this provider.

Returns:

An instance of a concrete Environment object.

Return type:

EnvironmentBase

get_input_anchor(name: str) E1InputAnchor[source]

Get an input anchor by name.

Parameters:

name – The name of the anchor to get.

Returns:

An instance of a concrete InputAnchorBase object with the name requested.

Return type:

InputAnchorBase

get_output_anchor(name: str) E1OutputAnchor[source]

Get an output anchor by name.

Parameters:

name – The name of the anchor to get.

Returns:

An instance of a concrete OutputAnchorBase object with the name requested.

Return type:

OutputAnchorBase

property io: E1IO

Get the IO (input/output) object from this provider.

Returns:

An instance of a concrete IO object.

Return type:

IoBase

property logger: Logger

Get the Logger for the provider.

Returns:

Python logging object.

Return type:

Logger

property tool_config: Any

Get config XML.

ayx_python_sdk.providers.e1_provider.e1_record_packet module

E1 SDK Record Packet Definition.

class ayx_python_sdk.providers.e1_provider.e1_record_packet.E1RecordPacket(metadata: Metadata, df: pd.DataFrame)[source]

Bases: RecordPacket

E1 SDK Record Packet definition.

ayx_python_sdk.providers.e1_provider.events module

Observable event definitions.

class ayx_python_sdk.providers.e1_provider.events.ConnectionEvents(value)[source]

Bases: Enum

Events for connection objects.

CONNECTION_CLOSED = 'connection_closed'
CONNECTION_INITIALIZED = 'connection_initialized'
PROGRESS_UPDATE = 'progress_update'
RECORD_RECEIVED = 'record_received'
class ayx_python_sdk.providers.e1_provider.events.PluginEvents[source]

Bases: object

Events for plugin objects.

INCOMING_CONNECTION_ADDED = 'pi_add_incoming_connection'
OUTGOING_CONNECTION_ADDED = 'pi_add_outgoing_connection'
PI_CLOSE = 'pi_close'
PI_INIT = 'pi_init'
PI_PUSH_ALL_RECORDS = 'pi_push_all_records'
PLUGIN_FAILURE = 'plugin_failure'
PLUGIN_INITIALIZED = 'plugin_initialized'

ayx_python_sdk.providers.e1_provider.tool_config_loader module

Tool configuration loader definition.

class ayx_python_sdk.providers.e1_provider.tool_config_loader.ToolConfigLoader(tool_directory_name: str)[source]

Bases: object

Tool configuration loader definition.

get_tool_config() Dict[str, Any][source]

Get the tool config of this tool from its config.xml file.

get_tool_config_filepath() Path[source]

Get the path to the tool configuration file.

get_tool_install_metadata() ToolInstallMetadata[source]

Get tool install metadata.

class ayx_python_sdk.providers.e1_provider.tool_config_loader.ToolInstallMetadata(install_path: Path, venv_path: Path, install_type: ToolInstallType)[source]

Bases: object

Tool installation metadata.

class ayx_python_sdk.providers.e1_provider.tool_config_loader.ToolInstallType(value)[source]

Bases: str, Enum

Tool install type enumeration.

admin = 'admin'
alteryx = 'alteryx'
noinstall = 'noinstall'
user = 'user'

ayx_python_sdk.providers.e1_provider.workflow_config module

Alteryx tool workflow configuration definition.

class ayx_python_sdk.providers.e1_provider.workflow_config.WorkflowConfiguration(config_str: str)[source]

Bases: UserDict

Workflow configuration.

data
original_data

Module contents

E1 SDK Provider interface.

class ayx_python_sdk.providers.e1_provider.E1Environment(engine: AlteryxPythonSDK.AlteryxEngine, tool_id: int, plugin_proxy: E1PluginProxy)[source]

Bases: EnvironmentBase

Environment variables for Designer.

property alteryx_install_dir: Path

Get the Alteryx install directory.

Returns:

The Alteryx install directory as a Path object.

Return type:

Path

property alteryx_locale: Literal['en', 'it', 'fr', 'de', 'ja', 'es', 'pt', 'zh']

Retrieve the locale code from Alteryx Designer User Settings.

Returns:

The language/region that Alteryx is using to display messages.

Return type:

Locale

property designer_version: str

Return the version of Designer that is being used.

Returns:

A version in the format of 1.2.3.4

Return type:

str

get_settings_conf(keys: list, version_override: str = '') dict[source]

Parse xml to retrieve settings.

parse_settings_key_value(settings_str: str, line_delimiter: str = '\n', key_delimiter: str = '=') dict[source]

Extract a key value pair from an xml text entry set by Designer.

property proxy_configuration: dict

Retrieve proxy config from UserSettings.xml.

property tool_id: int

Get the current tool’s workflow ID.

Returns:

Tool’s ID (specified by developer).

Return type:

int

property update_mode: UpdateMode

Get the type of update running.

Returns:

Enumeration corresponding to the update mode that the workflow is running in.

Return type:

UpdateMode

property update_only: bool

Check if the engine is running in update-only mode.

Returns:

Boolean value that indicates if the engine is running in update only.

Return type:

bool

update_tool_config(new_config: dict) None[source]

Update the tool’s configuration.

Parameters:

new_config – The new configuration to set for the tool.

Return type:

None

property workflow_dir: Path

Get the directory for the currently-running workflow.

Returns:

The workflow directory as a Path object.

Return type:

Path

property workflow_id: str

Get the WorkflowRunGuid for the currently-running workflow.

Returns:

The workflow id.

Return type:

str

class ayx_python_sdk.providers.e1_provider.E1IO(engine: AlteryxPythonSDK.AlteryxEngine, tool_id: int)[source]

Bases: IoBase

Class that wraps all IO communication with Alteryx Designer.

create_temp_file(extension: str = 'tmp', options: int = 0) Path[source]

Create a temporary file managed by Alteryx Designer.

Parameters:
  • extension – The extension of the new file.

  • options

    Lifecycle management options for the temp file.

    0: A normal temp file. It is cleaned up by Designer when a Run completes.

    1: A temp file for a GUI element, like a browse, that the GUI is responsible for cleaning up.

    2: A temp file for a GUI element, like a browse, that the GUI is responsible for cleaning up. Additionally, the file name is not made to be unique. Use when the extension argument already contains a unique ID.

Returns:

Path to the new temp file.

Return type:

Path

decrypt_password(password: str) str[source]

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

error(error_msg: str) None[source]

Display an error message in the Alteryx Designer Results window.

Parameters:

error_msg – A string to show as an error in the Designer Results window.

info(info_msg: str) None[source]

Display an info message in the Alteryx Designer Results window.

Parameters:

info_msg – A string to show as an info message in the Designer Results window.

translate_msg(msg: str, *args: Any) str[source]

Translate a message to the current locale.

Deprecated since version 0.1.0a: translate_msg is not the recommended translation mechanism. Refer to the documentation on localization.

Parameters:
  • msg – A string to translate.

  • args – Arguments for string interpolation.

Returns:

The translated string.

Return type:

str

update_progress(percent: float) None[source]

Update tool progress.

Parameters:

percent – A number between 0 and 100 to indicate the progress percentage.

warn(warn_msg: str) None[source]

Display a warning message in the Alteryx Designer Results window.

Parameters:

warn_msg – A string to show as a warning in the Designer Results window.

class ayx_python_sdk.providers.e1_provider.E1InputAnchor(input_anchor_proxy: E1InputAnchorProxy)[source]

Bases: InputAnchorBase

Input anchor to the tool.

property allow_multiple: bool

Get the status that indicates if multiple connections are allowed.

Returns:

Boolean value that indicates if multiple connections are allowed.

Return type:

bool

property connections: List[InputConnectionBase]

Get the anchor connections.

Returns:

List of all the connections associated with the anchor.

Return type:

List[InputConnectionBase]

property name: str

Get the name of the input anchor.

Returns:

The name of the input anchor.

Return type:

str

property optional: bool

Get the status that indicates if the input anchor is optional.

Returns:

Boolean value that indicates if input anchor is optional.

Return type:

bool

class ayx_python_sdk.providers.e1_provider.E1OutputAnchor(output_anchor_proxy: E1OutputAnchorProxy, engine: AlteryxPythonSDK.AlteryxEngine)[source]

Bases: OutputAnchorBase

Output anchor definition.

property allow_multiple: bool

Get the status that indicates if multiple connections are allowed.

Returns:

Boolean value that indicates if multiple connections are allowed.

Return type:

bool

close() None[source]

Close the outgoing connection.

flush() None[source]

Flush the written records for this output connection.

property is_open: bool

Get status indicating if the anchor is open.

property metadata: Optional[Metadata]

Get the anchor metadata.

property name: str

Get the name of the output anchor.

Returns:

The name of the output anchor.

Return type:

str

property num_connections: int

Get the number of connections attached to the anchor.

Returns:

The number of downstream connections on this anchor.

Return type:

int

open(metadata: Metadata) None[source]

Open the output anchor.

Write the outgoing record metadata and open this connection for outgoing packets.

Parameters:

metadata – The metadata to set for this anchor.

property optional: bool

Get the status that indicates if the output anchor is optional.

Returns:

Boolean value that indicates if output anchor is optional.

Return type:

bool

update_progress(percent: float) None[source]

Update the progress on downstream connections.

Parameters:

percentage – The percentage to write to Designer, that indicates the progress of output on this anchor.

write(record_packet: RecordPacketBase) None[source]

Write a RecordPacket to the outgoing connection.

Parameters:

record_packet – The record packet to write to the output anchor.

class ayx_python_sdk.providers.e1_provider.E1PluginProxy(tool_id: int, alteryx_engine: AlteryxPythonSDK.AlteryxEngine, output_anchor_mgr: AlteryxPythonSDK.OutputAnchorManager)[source]

Bases: ObservableMixin

Base plugin to inherit from.

property all_connections_closed: bool

Getter that indicates if all input connections are closed.

property all_connections_initialized: bool

Getter that indicates if all input connections are initialized.

property all_required_connections_connected: bool

Getter that indicates if all required connections are connected.

anchor_builder: Optional[AnchorBuilder]
property callback_strategy: ConnectionCallbackStrategy

Generate the callback strategy for the tool.

close_output_anchors() None[source]

Close connection for all output anchors.

configure_logger() None[source]

Configure the logger.

engine
property environment: E1Environment

Get the Environment object from this provider.

failure_occurred
get_input_anchor(input_anchor_name: str) E1InputAnchorProxy[source]

Get an input anchor by name.

get_output_anchor(output_anchor_name: str) E1OutputAnchorProxy[source]

Get an output anchor by name.

handle_plugin_error(e: Exception) None[source]

Log a plugin error to the log and a generic error to Designer.

initialized
input_anchors: List[E1InputAnchorProxy]
property io: E1IO

Get the IO object from this provider.

property log_directory: Path

Get the log directory.

property log_filepath: Path

Get the log filename.

property logger: Logger

Get logger.

output_anchors: List[E1OutputAnchorProxy]
pi_add_incoming_connection(anchor_name: str, connection_name: str) ConnectionInterface[source]

Add incoming connection to the tool from the engine.

pi_add_outgoing_connection(anchor_name: str) bool[source]

Register an outgoing connection from this tool.

pi_close(b_has_errors: bool) None[source]

pi_close is useless. Never use it.

pi_init(workflow_config_xml_string: str) None[source]

Plugin initialization from the engine.

pi_push_all_records(n_record_limit: int) bool[source]

Push all records when no inputs are connected.

plugin_driver: Optional[E1PluginDriver]
push_all_metadata() None[source]

Push all metadata for anchors.

raise_missing_inputs() NoReturn[source]

Send a missing incoming inputs error to Designer.

record_batch_size: Optional[int]
property required_input_anchors: List[E1InputAnchorProxy]

Get the list of required input anchors for this tool.

tool_config_loader
tool_id
property tool_name: str

Getter for the tool name.

update_sys_path() None[source]

Update the sys.path to fix SDK issues.

The sys.path must be updated to include: - The venv path - The tool directory

in order for inline imports to work due to base SDK sys.path manipulation issues.

user_plugin
user_plugin_class: Type[Plugin]
user_plugin_directory_name: str
workflow_config
class ayx_python_sdk.providers.e1_provider.E1Provider(plugin_proxy: E1PluginProxy, workflow_config: WorkflowConfiguration)[source]

Bases: ProviderBase

Provides resources generated from the E1 Python SDK.

property dcm: E1DCM

Get the DCM object from this provider.

Returns:

An instance of a concrete Dcm object.

Return type:

Dcm

property environment: E1Environment

Get the Environment object from this provider.

Returns:

An instance of a concrete Environment object.

Return type:

EnvironmentBase

get_input_anchor(name: str) E1InputAnchor[source]

Get an input anchor by name.

Parameters:

name – The name of the anchor to get.

Returns:

An instance of a concrete InputAnchorBase object with the name requested.

Return type:

InputAnchorBase

get_output_anchor(name: str) E1OutputAnchor[source]

Get an output anchor by name.

Parameters:

name – The name of the anchor to get.

Returns:

An instance of a concrete OutputAnchorBase object with the name requested.

Return type:

OutputAnchorBase

property io: E1IO

Get the IO (input/output) object from this provider.

Returns:

An instance of a concrete IO object.

Return type:

IoBase

property logger: Logger

Get the Logger for the provider.

Returns:

Python logging object.

Return type:

Logger

property tool_config: Any

Get config XML.