Exporting to SPSS files in Python Django?

邮差的信 提交于 2019-12-01 23:55:31

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

alxbl

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!