skillfed

saspy

A Python interface to SAS

saspy v5.108.6 311.5K downloads/30d#7,731 on PyPI409
Permissive license Active released

What it is and what it does

SASPy is a bridge between Python and SAS that lets you write Python code to submit SAS programs to local or remote SAS systems and retrieve results back into Python. It converts between SAS datasets and Pandas DataFrames, supports multiple deployment types (Linux, Windows, MVS), and works in notebooks, IDEs, and batch scripts. The package generates SAS code from Python objects and methods, or accepts explicit SAS code you write, then returns analytics results as text, HTML5 documents, or structured data.

The package is designed for teams that need to combine SAS and Python capabilities in a single workflow—for instance, preprocessing data in Python, running SAS analytics, and post-processing results back in Python. It has no runtime dependencies beyond Python itself, though it requires an active SAS installation to connect to. The project is actively maintained and has been in development since 2016.

Use it for:

  • Submit SAS procedures from Python and retrieve results as Pandas DataFrames for further analysis.
  • Convert SAS datasets to Pandas for Python-based machine learning, then push results back to SAS.
  • Run SAS analytics in Jupyter or Databricks notebooks while controlling workflow logic from Python.
  • Automate SAS batch jobs from Python scripts, capturing output and graphics programmatically.
  • Build mixed-language data pipelines that leverage both SAS and Python strengths in a single process.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

SASPy connects Python to SAS deployments (local or remote) to run SAS code and return results as text, HTML, or Pandas DataFrames, enabling mixed Python/SAS workflows.

Yes, if you need to integrate SAS with Python workflows. The package is actively maintained, has no external dependencies, uses a permissive license, and is designed for exactly this use case. Install only if you have access to a SAS 9.4+ or SAS Viya 3+ deployment and need bidirectional Python-SAS integration.

Install

saspy on PyPI

pip

pip install saspy

uv

uv add saspy

poetry

poetry add saspy

Installing saspy

Before you install

Low install friction with no runtime dependencies. The package is actively maintained, with a recent release 22 days ago and ongoing repository activity. Suitable for straightforward installation.

License in practice

Licensed under Apache License 2.0 (permissive), allowing use in commercial and open-source projects with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

pip install saspy

import saspy
sas = saspy.SASsession()
result = sas.submit('proc print data=sashelp.class; run;')
print(result)

Requires a SAS 9.4+ or SAS Viya 3+ deployment to connect to; Python alone cannot run SAS code without an accessible SAS instance.

Verify before relying

  • Whether the package works with Python versions beyond 3.5 despite the old classifiers listed (3.4, 3.5).
  • Specific configuration steps required for each SAS deployment type (Linux, Windows, MVS, Jupyter, Databricks, Zeppelin).
  • Performance characteristics and latency when connecting to remote SAS instances.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 22 days since the last release
Last repo commit
First released
Downloads 311,533/month — #7,731 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: saspy-5.108.6-py3-none-any.whl

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Topic :: System :: Shells

Tags

python sas interfacerun sas code from pythonsas pandas integrationpython sas connectorsas analytics pythonsas data frame conversionpython sas deployment
sas-integrationdata-interchangeanalytics-bridge

More Shells packages