Skip to main content

A package containing a Python class and associated methods to create and manipulate SAS Studio Custom Step files.

Project description

py-sas-studio-custom-steps: A Python package for SAS Studio Custom Steps

This repository provides a Python class and associated methods to create, access and manipulate SAS Studio Custom Steps. SAS Studio Custom Steps are low-code components designed for analytical and data engineering operations on the SAS Viya platform. They provide a user interface for parameters which are then used to execute an associated SAS program. Custom Steps provide easy access to common operations, boost code reusability, and help establish best practices in programming.

As SAS Viya continues to welcome a diverse set of users with different preferences (e.g. programming, low-code / no-code), a Python-based framework for interacting with custom steps accelerates code reusability and assists rapid development and testing of custom steps. This package can be used to access and port custom step capabilities from SAS Studio and non-SAS Studio applications, such as SAS Viya Workbench, Visual Studio Code, Claude Code and other Python IDEs.

Note that SAS Viya, SAS Viya Workbench etc. refer to commercial software provided by SAS Institute. The open-source package in this repository is not officially provided or supported by SAS Institute. It only contains a convenient tool for manipulating a SAS Studio Custom Step, a serialized file. It does not execute SAS algorithms or procedures. SAS programs and SAS Studio Custom Steps require a SAS / SAS Viya license to execute.

Installation

  1. Clone this repository
  2. To install locally in editable mode, refer here

Run the following command for a pip installation of the package from PyPi.

pip install --upgrade py-sas-studio-custom-steps

Usage - quick example

To import the package inside a Python script:

import py_sas_studio_custom_steps as py_sas_step

custom_step = py_sas_step.CustomStep()

or, as an alternative, import the object directly:

from py_sas_studio_custom_steps import CustomStep

custom_step = CustomStep()

Refer this notebook for a detailed example.

Key Operations

This package will evolve and add more functionality in a gradual manner. Important operations that are currently available include:

  • extract_sas_program: Extract the SAS program from a given custom step
  • create_custom_step: Write a custom step (CustomStep) object to a SAS Studio Custom Step (.step) file
  • add_starter_page and add_about_page: Rapidly create a starter SAS Studio Custom Step and edit further
  • attach_sas_program: Attaches content of a SAS program to a custom step object.
  • attach_ui: Attaches UI component definitions to a custom step object.

and, as a bonus, some convenient generative AI functionality (note that this also requires a Gemini API Key from Google which is used to call a Gemini Flash 3.5 Large Language Model (LLM))

  • generate_readme: Creates a README file as per user specification.
  • create_sas_program: Creates a SAS program through an LLM's assistance based on a user prompt
  • modify_sas_program: Modifies the SAS program component of a custom step through an LLM's assistance based on a user prompt
  • create_ui: Creates a user interface through an LLM's assistance based on a user prompt

Documentation

Refer this page for a list of all available methods and attributes.

Generative AI usage

Some functions (described in Documentation) make use of a Large Language Model (LLM)(Gemini 3.5 Flash). While you are free to modify the code to accommodate other LLMs, this is at present the only LLM supported. Read this important note regarding functions that make use of Generative AI.

IMPORTANT: All outputs returned from Generative AI tools such as LLMs should be carefully reviewed prior to actual use. Quality of Generative AI outputs are determined by the Large Language Model in use and may be incorrect. Always review the same.

Convenience: tasks.json

This repository contains a tasks.json meant for use in Visual Studio Code which helps clean up temporary files and stands up a virtual environment for quick development and exploration. Remove this file if you do not want to have Visual Studio Code run the tasks in tasks.json.

Change Log

  • Version: 1.0.0 (28MAY2025)
    • Major release
  • Version: 0.9.9 (27MAY2025)
    • Prior to a major release
  • Version: 0.5.1 (17JAN2025)
    • Method to create a README file
  • Version: 0.4.0 (09JAN2025)
    • Methods to add SAS program and UI components to a Custom Step
  • Version: 0.3.3 (22SEP2024)
    • New method to return pages from a Custom Step object
  • Version: 0.2.3 (07AUG2024)
    • New method to instantiate a class through a Custom Step file
  • Version: 0.1.3 (07AUG2024)
    • Initial version plus teething issues / doc fixes

Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_sas_studio_custom_steps-1.0.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_sas_studio_custom_steps-1.0.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file py_sas_studio_custom_steps-1.0.0.tar.gz.

File metadata

File hashes

Hashes for py_sas_studio_custom_steps-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dc3bfc3c44f034a488fee48d7b3cfe1ae967826abf6cd54cd86254cffc5899b5
MD5 0b065686e9053868fd37e8d2753b0d20
BLAKE2b-256 a0b09793eb15c4bf9d57fa30244ab0f0a312bbb49f56dacf831a8c598d6e0ed3

See more details on using hashes here.

File details

Details for the file py_sas_studio_custom_steps-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for py_sas_studio_custom_steps-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36c5c0b53d833f481a6d9de33c1b0bad7bdbbf5c5fae3400fe8c65f793cf6559
MD5 6e0762081ee020c75ceaaf445e8a8e3a
BLAKE2b-256 d4b144ae65231b91fa1e212113c5a35ba512f7279ce38d4fda2da8953d9c017b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page