A Python module for creating, reading, and editing Alteryx Designer workflows entirely in code.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
A Python module for creating, reading, and editing Alteryx Designer workflows entirely in code.
Using pyx, developers can:
- Read existing Alteryx workflows into a structured set of Python objects
- Create new Alteryx workflows as a structured set of Python objects
- Edit Alteryx workflows and the tools contained within
- Run Alteryx workflows on systems where Alteryx Designer is installed (Windows only)
Written and tested using Python 3.8.x. Also uses these Python packages:
To get a local copy up and running follow these simple steps.
You will need to install the following Python modules, either individually or using the included requirements.txt:
- xmltodict
pip install --user xmltodictUsing the requirements.txt to install all requirements at once:
pip install -r --user requirements.txt- Clone the repo
git clone https://github.com/bigangryguy/pyx.git- Install requirements (see above)
There is no installer configured for the module yet, but one is coming soon.
The file example-1.py shows a complete example of reading and modifying an example workflow (contained in the
workflows folder).
To start, import the Workflow and OutputTool classes.
from pyx.workflow import WorkflowThen read a workflow using the Workflow class static read() function.
workflow: Workflow = Workflow.read('workflows/Example-Simple2.yxmd')Next, create a new OutputTool instance with a tool ID from the workflow get_new_tool_id() helper function. Place the
new tool below the tool with ID 6 using the workflow position_below() helper function.
outputTool: OutputTool = OutputTool(workflow.get_new_tool_id())
outputTool.position = workflow.position_below(6)Many classes use a fluent interface to make chaining function calls possible. Add the new tool to the workflow and connect it to the tool with ID 5.
workflow.add_tool(outputTool) \
.add_connection(5, 'Output', outputTool.tool_id, 'Input')Finally, write the edited workflow to a new file using the Workflow class static write() function.
Workflow.write(workflow, 'workflows/Example-1-Output.yxmd')See the open issues for a list of proposed features (and known issues).
- Add more concrete tool implementations
- Until then, the base Tool class supports all existing tools through the
propertiesproperty, which exposes the tool configuration as a set of nestedOrderedDict. See thexmltodictmodule documentation for the syntax
- Until then, the base Tool class supports all existing tools through the
- Add more API documentation
- Implement unit tests
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.md for more information.
David Wilcox - @davidtwilcox - [email protected]
Project Link: https://github.com/bigangryguy/pyx
- Alteryx
- Ned Harding - Founder and former CTO of Alteryx