It’s here! To tell you the truth, it has been around for a while, but with release 1.0.0, py-sas-studio-custom-steps helps you programmatically create, modify and enhance SAS Studio Custom Steps, freeing up time and improving developer productivity.
SAS Studio Custom Steps are low-code components designed for analytical and data engineering operations on the SAS Viya platform. They offer a user interface for receiving parameters which are then executed in an associated SAS program. Custom Steps provide easy access to common operations, boost code reusability, and help establish best practices in programming.
With py-sas-studio-custom-steps, an open-source contribution developed as a personal project, you now have a Python interface to work with custom steps that enhances your custom step development through automation and consistency. Offered as a Python package installable from PyPi, the default third-party package repository for Python, py-sas-studio-custom-steps contains a CustomStep class with a host of convenient methods.
Note that this is not a SAS product. It deals with a JSON representation of a SAS Studio custom step, which is saved as a .step file in serialised format. If you’re reading this sometime in the future (after this post was first published, that is, 🙂 ), note that future changes to custom step representation might require a change to this package.
Let’s quickly walk through an example. Install py-sas-studio-custom-steps through the standard pip install method. You can also use uv or other package managers that work with PyPi if you like.
pip install py-sas-studio-custom-steps
# or
uv pip install py-sas-studio-custom-steps
That was fast. Next, let’s look at a simple method. What if you want a new custom step? A new, empty custom step. Import the package and then instantiate a CustomStep object. This represents a custom step as a Python object, to which you can add a SAS program and a UI definition.
Searching for how to add a starter page? Simply make use of built-in methods to add a starter page and an About page.
from py_sas_studio_custom_steps import CustomStep
cs = CustomStep()
cs.add_starter_page()
cs.add_about_page()
Notice the additional bonus here. Not only were you able to do the above, but you were able to do this in SAS Studio, making use of Python integration within SAS Studio! The benefit from this interface is that now you have code sitting in your Viya environment which can be governed and automated as part of your DataOps pipelines.
Let’s go further. Most custom steps are representation of repeatable code that already exists in SAS programs and macros. Custom step developers typically (though, of course, not always) start with a SAS program and then write a user interface (UI) for the same. Using the CustomStep class, you can easily attach existing SAS programs to be associated with the custom step object, as follows.
Even further, what if you want to improve on an existing custom? The `load_step_file()` method helps you by loading the contents of an existing custom step file to the step object.
Note that we can load a step file either from the file system or a GitHub URL. Very useful in cases when the custom step is part of a repository such as https://github.com/sassoftware/sas-studio-custom-steps
Now for some fun. Really, really smart or really, really lazy people, depending on your point of view, might wish to create their own custom step with AI assistance. Following the custom step instructions to optionally install the google-genai Python package, you have access to methods that use the Google Gemini Flash 3.5 model to assist in AI-generated code.
Before we go further, the usual caveats when taking assistance from AI:
Enough caveating. Trusting you are big little boys and girls, let’s look at an example.
We have touched upon most of the basic functions around creating a custom step, attaching code, and saving your output, all through a Python program, which implies you can automate most tasks in custom step development. In addition to automation, consider these other two use cases.
This was meant to be a quick introduction to py-sas-studio-custom-steps and it’s highly likely you might come up with more ideas and uses as you practice using this package. Get in touch here.
Visit the Tips & Tricks page for setup guidance, demos, and practical examples that show how Copilot supports your workflows.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.