Edit page in Livemark
(2022-09-19 18:33)

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())
It's a beta version of Frictionless Framework (v5). Read Frictionless Framework (v4) docs for a version that is currently installed by default by pip.