Alteryx IO Discussions

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.

Alteryx Python SDK Macro

mike_m_12
6 - Meteoroid

I was wondering how I would create a python macro for alteryx. I've pip installed both ayx-python-sdk and ayx-plugin-cli and created an alteryx workspace with the "ayx_plugin_cli sdk-workspace-init" command. It successfully created a workspace and generated the backend folder, configuration folder, and ayx_workspace.json but when I create a main.py in the backend folder and try to run "from ayx import Alteryx" I get the error "ayx could not be resolved". Not sure if I'm missing something - maybe it's my IDE because I'm using vscode? Any help would be greatly appreciated

1 REPLY 1
aneeshnazar
Alteryx
Alteryx

Once you've created the workspace, the next thing you'll need to do is create a plugin - in Designer terms, the workspace is a YXI that contains one or many tools, and the plugin is one of those individual tools. The command to create a plugin is `ayx_plugin_cli create-ayx-plugin` - once that's done, you'll have an `ayx_plugins` python package, with scaffolded tool code that you can write your business logic in