A Python 2.7 package for parsing question metadata from Open Data Kit and compatible (e.g. KoBo Toolbox) forms and exporting that metadata to an SPSS ".sps" syntax file.
To install:
git clone --depth 1 https://github.com/esmail/odk_to_spss_syntax.git
cd odk_to_spss_syntax
make env && source env/bin/activate # If you don't want to install system-wide.
pip install -e .
To execute:
odk_to_spss_syntax -h # Show execution help.
odk_to_spss_syntax my_odk_form.json my_odk_form_syntax.sps
You can also import and use the package from other Python code as follows:
import odk_to_spss_syntax
json_form_text= open('odk_form.json', 'r').read()
syntax_text= odk_to_spss_syntax.from_json(json_form_text)
Documentation here.