Spaces:
Paused
Paused
Download src/readers/spss.py from CGIAR/PERI-AI-dev: direct link, hf CLI and curl.
- Browser
- Download file 379 Bytes
-
https://huggingface.co/spaces/CGIAR/PERI-AI-dev/resolve/main/src/readers/spss.py
- Command line
-
hf download hf://spaces/CGIAR/PERI-AI-dev/src/readers/spss.py
-
curl -L -o spss.py https://huggingface.co/spaces/CGIAR/PERI-AI-dev/resolve/main/src/readers/spss.py
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 [] | |