skillfed

sas7bdat

A sas7bdat file reader for Python

sas7bdat v2.2.3 157.3K downloads/30d#10,760 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

sas7bdat is a pure-Python reader for SAS7BDAT files, the binary data format used by SAS statistical software. It parses these files without requiring SAS to be installed, returning rows as lists of typed values (strings, floats, dates, times) and optionally converting to pandas DataFrames. The package also includes a command-line tool, `sas7bdat_to_csv`, for batch conversion and metadata inspection.

The library was originally ported from an R implementation but has been substantially rewritten. While the author reports successful testing on sample files, the project has been abandoned since 2019 with no active maintenance. This means new SAS file format features, compression methods, or Python version incompatibilities will not be addressed.

Use it for:

  • Import SAS data files into Python workflows without installing SAS software or licensing costs.
  • Batch convert legacy SAS7BDAT files to CSV format for archival, migration, or sharing with non-SAS users.
  • Load SAS statistical datasets into pandas for analysis in Jupyter notebooks or data science pipelines.
  • Extract metadata and column attributes from SAS files for data documentation or schema inspection.
  • Automate data pipelines that consume SAS output files from external statistical analyses.

Worth the install?

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

Reads SAS7BDAT files (SAS statistical software data format) using pure Python, with no SAS software required, and optionally converts them to CSV or pandas DataFrames.

Yes, but with caution: install if you need to read SAS7BDAT files and have no alternative, and if your files match the formats already tested. The permissive MIT license and zero runtime dependencies make it low-risk to try. However, do not rely on it for production systems or new SAS file formats—the abandonment since 2019 means bugs in modern Python versions or recent SAS formats will not be fixed. Test thoroughly with your actual data before committing to it.

Install

sas7bdat on PyPI

pip

pip install sas7bdat

uv

uv add sas7bdat

poetry

poetry add sas7bdat

Installing sas7bdat

Before you install

High install friction: the package is abandoned (last release 2019-07-15, no recent commits), with no runtime dependencies but marked as production-stable despite years without maintenance. Installation itself is straightforward, but the lack of active support means bugs in newer Python versions or SAS file formats will not be fixed.

License in practice

MIT license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute this code freely as long as you include the original license notice.

Quickstart

pip install sas7bdat

from sas7bdat import SAS7BDAT
with SAS7BDAT('foo.sas7bdat', skip_header=True) as reader:
    for row in reader:
        print(row)

df = reader.to_data_frame()

Verify before relying

  • Whether the package works reliably with modern Python versions (3.9+) given the abandonment status and last release in 2019.
  • Compatibility with recent SAS file format variations or compression methods introduced after 2019.
  • Whether the approximately three hundred sample files tested represent comprehensive coverage or edge cases remain untested.

Package facts

License MIT (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 2,587 days since the last release
First released
Downloads 157,278/month — #10,760 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sas7bdat-2.2.3.tar.gz

Keywords: sas, sas7bdat, csv, converter

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Text ProcessingTopic :: Utilities

Tags

read sas7bdat files pythonsas data format readersas7bdat to csv convertersas statistical data importparse sas data filessas file parser library
data-format-parsersas-interopabandoned-but-stable

More Utilities packages