Edit page in Livemark
(2024-11-22 08:02)

Spss Format

Frictionless supports reading and writing SPSS files.

pip install frictionless[spss]
pip install 'frictionless[spss]' # for zsh shell

Reading Data

You can read SPSS files:

from pprint import pprint
from frictionless import Resource

resource = Resource('table.sav')
pprint(resource.read_rows())

Writing Data

You can write SPSS files:

from frictionless import Resource

source = Resource(data=[['id', 'name'], [1, 'english'], [2, 'german']])
target = source.write('table-output.sav')
pprint(target)
pprint(target.read_rows())