saspy
A Python interface to SAS
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 saspyuv
uv add saspypoetry
poetry add saspyInstalling 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
Tags
More Shells packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
ipythonIPython is an enhanced interactive Python shell…
permissive · top 1,000 on PyPI
argcompleteProvides bash and zsh tab completion for Python…
permissive · top 1,000 on PyPI
humanfriendlyFormats and parses numbers, file sizes,…
permissive · top 1,000 on PyPI
coloredlogsAdds colored output to Python's standard…
permissive · top 1,000 on PyPI
pyreadstatReads and writes SAS, SPSS, and Stata data…
permissive · top 5,000 on PyPI
sas7bdatReads SAS7BDAT files (SAS statistical software…
permissive · top 15,000 on PyPI
pyspark-clientPython client for connecting to Apache Spark…
permissive · top 5,000 on PyPI
tablibTablib converts tabular data between multiple…
permissive · top 5,000 on PyPI
datacompyDataComPy compares two DataFrames across…
permissive · top 5,000 on PyPI
awsglue-devProvides Python interfaces to AWS Glue's ETL…
unclear · top 5,000 on PyPI
xlwingsxlwings lets you call Python from Excel and…
permissive · top 5,000 on PyPI
bigframesBigFrames provides a pandas-compatible…
permissive · top 5,000 on PyPI
itablesRenders Pandas and Polars DataFrames as…
permissive · top 5,000 on PyPI