Exporting to SPSS files in Python Django?
Asked Answered
D

2

2

i need to export data to SPSS file format in Python (Django), but i can't find util information in google.

Is there some way to do this? Someone has tried?

thanks in advance!

Draghound answered 24/6, 2011 at 5:24 Comment(0)
E
7

The savReaderWriter package can be used to read or write SPSS files (.sav, zsav), including metadata: https://pypi.python.org/pypi/savReaderWriter/3.1.2

Expound answered 25/8, 2013 at 19:51 Comment(0)
D
3

As far as I am aware, the only API provided by IBM to interact with SPSS is designed to be used in C/C++.

You will have to look up the appropriate SPSS developer's guide for your version of SPSS and download the required files from their website.

That being said, I know you can load a DLL and use it from within Python with ctypes (See this question).

Once you have the API, you can easily read/write/create SPSS database files. I am not sure there are any Django plugins that provide this functionality, but you might be able to write your own. Additionally using ctypes somewhere in your view directly might be a quicker way to do it.

Also, I know later versions of SPSS have Python scripting support but I don't think that could come in handy at all.

EDIT

Here is a list of resources that might be useful for different versions of SPSS:

it turns out all versions after 14.0 use the same API, so I fixed the links to reflect that. Apparently they host a different copy of the file with each version.

Doe answered 24/6, 2011 at 6:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.