Pascal’s Triangle – Alteryx Python SDK
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 the
- Import libraries
- Bring Pascal Function
- Update pi_push_all_records
Finally, I made sure to follow the steps detailed in the official documentation to obtain the installer and proper dependencies:
- Create a virtual environment.
- Install packages in the virtual environment.
- Create the
requirements.txtfile using pip freeze.
- Create the installer .yxi as described in previous posts.
Voilà. Tool ready (here).
Please, leave any comments below or reach me at dsmd4vid