odk_to_spss_syntax package

Submodules

odk_to_spss_syntax.main module

Created on Jun 13, 2014

Provides the outward interface of the package for ingesting input and producing output.

odk_to_spss_syntax.variable_metadata module

Created on Jun 13, 2014

class odk_to_spss_syntax.variable_metadata.VariableMetadata[source]

Bases: odk_to_spss_syntax.variable_metadata._VariableMetadata

A VariableMetadata object contains the metadata about an individual form variable. The class inherits from a semi-anonymous namedtuple() (_VariableMetadata) that handles object construction and the creation of immutable attribute accessors.

Parameters:
  • name (str) – The encoded name of the variable (e.g. “a01”)
  • label (str) – The variable’s readable label (e.g. “What is your sex?”)
  • value_mappings (dict) – A dictionary that maps encoded value names (e.g. “0”, “1”) to value labels (e.g. “Female”, “Male”)
classmethod export_spss_syntax(variable_metadata_list)[source]

Export the supplied VariableMetadata objects to a string for use in an SPSS syntax file.

Parameters:variable_metadata_list (list(VariableMetadata)) – The metadata to export.
Returns:An SPSS-syntax-file-formatted string.
Return type:String
classmethod import_json(odk_json_text)[source]

Parse question metadata (e.g. names, labels, value mappings) from the supplied JSON-formatted ODK form text.

Parameters:odk_json_text (str) – The JSON-formatted text of the form being imported.
Returns:VariableMetadata objects that correspond to the JSON form’s questions.
Return type:list(VariableMetadata)

Module contents

odk_to_spss_syntax – Produce a SPSS syntax file that corresponds to the provided ODK form.

odk_to_spss_syntax is a Python package for extracting metadata about the questions contained in an Open Data Kit form and exporting that metadata to an SPSS ”.sps” syntax file.

@copyright: 2014 Esmail Fadae. All rights reserved.

@license: GPL v3

@deffield updated: 2014-06-15