The Python SDK is in a Beta state. The tools and related documentation are under development.
The Alteryx Python SDK is a Python extension module that provides users the ability to write custom Alteryx plugin tools using Python. Use the Python SDK to access core elements of the Alteryx Engine framework.
Alteryx picks up plugins from the bin/HtmlPlugins folder found within its install folder. In this folder, create a new folder with the name of your plugin.
bin/HtmlPlugins/MyNiftyPlugin
Inside your plugin folder, you need to have the following 4 files:
A .xml file to set tool configuration
MyNiftyPluginConfig.xml
A .py file to set tool function
MyNiftyPluginEngine.py
A .html file to set tool appearance
MyNiftyPluginGui.html
A .png file to display as an icon within Alteryx
MyNiftyPluginIcon.png
To see a complete example implementation, navigate to bin/HtmlPlugins/PythonSDKExample.
The Alteryx Python SDK is compiled to run on Python version 3.6.0 that is part of the Miniconda install currently installed as part of the Alteryx Designer installation.
The Alteryx Python SDK is not designed to run in a standalone Python environment; it is invoked by the Alteryx Engine as part of an Alteryx workflow by initializing an embedded Python process that is specifically designed for interfacing with plugin modules.
To start the design of an Alteryx Python SDK plugin module, import the Alteryx Python SDK extension module at the beginning of your script:
import AlteryxPythonSDK
The main body of the script is implemented in the AyxPlugin class. The Alteryx Engine requires the AyxPlugin class when it runs your script. If you do not have the AyxPlugin class or it is not named correctly, the following atttribute error exception will be raised:
AttributeError: module '__main__' has no attribute 'AyxPlugin'