How to create a Alteryx Python Engine SDK Tool?

A Alteryx app uses the Alteryx Python SDK extension module to write a custom Alteryx plugin application, accessing some core elements of the AlteryxEngine framework. A app needs to use data gathered from the data stream and manipulate the data in accordance with the user input from the application’s GUI.

Basic Files

Each application requires a configuration file, gui file, engine file, and application icon. To help with the development process, you can find in this repository a template with the initial files.

your_appConfig.xml

The application configuration file defines the application configuration. The name must be the directory name with the suffix Config and the file extension .xml.

Customize

Change the name of this file for your app’s name. Avoid spaces or special characters. For legibility, camel case is recommended. Then go to:

  1. AlteryxJavaScriptPlugin > EngineSettings > EngineDllEntryPoint="your_app.py"
  2. AlteryxJavaScriptPlugin > GuiSettings > Html="your_app.html"
  3. AlteryxJavaScriptPlugin > GuiSettings > Icon="your_app.png"
  4. AlteryxJavaScriptPlugin > Properties > MetaInfo and customize with your info.

your_app.html

The HTML GUI SDK is a library of extensions used to create the graphical user interface (GUI) for the configuration panel for a custom Alteryx Designer application.

Customize

Change the name of this file for your app’s name. Avoid spaces or special characters. For legibility, camel case is recommended. Then go to:

  1. html > head > title > Your App Title

your_app.py

The Alteryx Python SDK extension module is used to write custom Alteryx plugin applications, while accessing core elements of the AlteryxEngine framework.

Customize

Change the name of this file for your app’s name. Avoid spaces or special characters. For legibility, camel case is recommended.

your_app.png

A .png icon to display as your application’s icon within Designer.

Customize

Change the name of this file for your app’s name. Avoid spaces or special characters. For legibility, camel case is recommended.

The Application Folder

Your application files must be saved in the following structure:

.
└─ C:\ProgramData\Alteryx\applications\your_app\
  └─ your_appConfig.xml
  └─ your_app.html
  └─ your_app.py
  └─ your_app.png

Configure Your Application Environment

It is highly recommend that you develop your custom application inside of a virtual environment. With Miniconda, you can create and activate a virtual environment.

Step 1

Navigate to the Miniconda env under the Alteryx folder

$ cd C:\Program Files\Alteryx\bin\Miniconda3\Scripts\

Step 2

Once you are there you have now to create your conda env. You must create an env (python -m venv) pointing to the folder where your application files are located.

C:\Program Files\Alteryx\bin\Miniconda3\Scripts\ $ python -m venv C:\ProgramData\Alteryx\applications\your_app\

Step 3

After running the previous command, you will now see four new files inside the folder where your application files are located.

.
└─ C:\ProgramData\Alteryx\applications\your_app\
  └─ pyvenv.cfg (created)
  └─ your_app.py
  └─ your_app.html
  └─ your_appConfig.xml
  └─ your_app.png
  └─ Include (created)
  └─ Lib (created)
  └─ Scripts (created)

Step 3

Now you can find a folder called Scripts, where will be hosted your env. To activate this created folder you must:

$ activate C:\ProgramData\Alteryx\applications\your_app\

Step 4

Now that your env is activated, you can install whatever package is needed by your application.

(your_app)$ pip install <your_package>

You can easily check the installed packages under the folder:

$ cd C:\ProgramData\Alteryx\applications\your_app\Lib\site-packages\

Using your Application

Now you can open you Alteryx software and in the SearchBar you can type the name of the application. The name you have to look for should be the same name found in your_appConfig.xml > AlteryxJavaScriptPlugin > Properties > MetaInfo > Name > My Application Name.

Sometimes it can take a while to show the app there. Be patient.

Leave a Reply