Wiki

Clone wiki

savReaderWriter / Home

savReaderWriter

Note: You can find the savReaderWriter documentation on Pypi.

Important

The :mod:`savReaderWriter` program uses the SPSS I/O module (.so, .dll, .dylib, depending on your Operating System). Users of the SPSS I/O module should read the International License Agreement before using the SPSS I/O module. By downloading, installing, copying, accessing, or otherwise using the SPSS I/O module, licensee agrees to the terms of this agreement. Copyright © IBM Corporation 1989, 2012 --- all rights reserved.

SavWriter -- Write Spss system files

Typical use:

savFileName = "someFile.sav"
records = [['Test1', 1, 1], ['Test2', 2, 1]]
varNames = ['var1', 'v2', 'v3']
varTypes = {'var1': 5, 'v2': 0, 'v3': 0}
with SavWriter(savFileName, varNames, varTypes) as writer:
    for record in records:
        writer.writerow(record)

SavReader -- Read Spss system files

Typical use:

with SavReader(savFileName, returnHeader=True) as reader:
    header = reader.next()
    for record in reader:
        process(record)

SavHeaderReader -- Read metadata in Spss system files

Typical use:

with SavHeaderReader(savFileName) as header:
    metadata = header.all()

Updated