PERI-AI-dev / src /readers /spss.py
LIANJie-Jason's picture
fix: Round 14 — 28 Tier 1 + Tier 2 bugs fixed across 17 source files
f95cdb7
Raw History Blame Contribute Delete
379 Bytes
"""Reader for SPSS .sav files via pyreadstat."""
from src.readers.stata import _dataframe_to_pages
def read_spss(file_path: str) -> list[dict]:
try:
import pyreadstat
df, meta = pyreadstat.read_sav(file_path)
return _dataframe_to_pages(df, meta)
except Exception as e:
print(f"Warning: Could not read {file_path}: {e}")
return []