15 August 2018
The original version of this article with working code is here
.
After a couple of posts (I & II) getting my feet wet with the Python SDK module for Alteryx I finally get to build a tool that actually uses some code:The Pascal's Triangle generator
Following the original recipe, I duplicated a sample folder, renamed the files, removed most of the superfluous code, added the pieces I needed and, finally, connected my code with the AyxPlugin.All so that I can generate my own Pascal's Triangles with a single tool.The main difference with the previous tools is that the code references two python libraries that are not part of the miniconda distribution that comes with Alteryx:On hindsight, this is an overkill and I could/should have just written a self-contained implementation. BUT I did want to play with importing packages and virtual environments so...The installer is available here. Install it by double clicking on it, it will appear in the “Laboratory” tools. Unzip the .yxi to explore the files.I first wrote a working example using Jupyter:Then I migrated that code into thePascalTriangleEngine.py
- Import libraries
- Bring Pascal Function
- Update pi_push_all_records
- Create a virtual environment.
- Install packages in the virtual environment.
- Create the
requirements.txt
file using pip freeze. - Create the installer .yxi as described in previous posts.