onadata.apps.logger package

Subpackages

Submodules

onadata.apps.logger.admin module

onadata.apps.logger.factory module

onadata.apps.logger.import_tools module

onadata.apps.logger.tasks module

onadata.apps.logger.views module

onadata.apps.logger.xform_fs module

ODK Collect/Briefcase XForm instances folder traversal.

class onadata.apps.logger.xform_fs.XFormInstanceFS(filepath)

Bases: object

A class to traverse an ODK Collect/Briefcase XForm instances folder.

classmethod is_valid_instance(filepath)

Returns True if the XML at filepath is a valid XML file.

property metadata_directory

Returns the metadata directory.

property osm

Returns all .osm file paths.

property photos

Returns all .jpg file paths.

property xml

Returns the submission XML

onadata.apps.logger.xform_instance_parser module

XForm submission XML parser utility functions.

exception onadata.apps.logger.xform_instance_parser.AttachmentNameError

Bases: Exception

exception onadata.apps.logger.xform_instance_parser.DuplicateInstance

Bases: Exception

exception onadata.apps.logger.xform_instance_parser.InstanceEmptyError

Bases: InstanceParseError

exception onadata.apps.logger.xform_instance_parser.InstanceEncryptionError

Bases: Exception

exception onadata.apps.logger.xform_instance_parser.InstanceFormatError

Bases: Exception

exception onadata.apps.logger.xform_instance_parser.InstanceInvalidUserError

Bases: Exception

exception onadata.apps.logger.xform_instance_parser.InstanceMultipleNodeError

Bases: Exception

exception onadata.apps.logger.xform_instance_parser.InstanceParseError

Bases: Exception

exception onadata.apps.logger.xform_instance_parser.NonUniqueFormIdError

Bases: Exception

class onadata.apps.logger.xform_instance_parser.XFormInstanceParser(xml_str, data_dictionary)

Bases: object

XFormInstanceParser - parses an XML string into an XML object.

get(abbreviated_xpath)
get_attributes()
get_flat_dict_with_attributes()

Adds the submission XML top level attributes to the resulting python object.

get_root_node()
get_root_node_name()
get_version()

Returns the submission XML version attribute.

get_xform_id_string()

Returns the submission XML id attribute.

parse(xml_str)

Parses a submission XML into a python dictionary object.

to_dict()
to_flat_dict()
exception onadata.apps.logger.xform_instance_parser.XLSFormError

Bases: Exception

onadata.apps.logger.xform_instance_parser.clean_and_parse_xml(xml_string)

Removes spaces between XML tags in xml_string

Returns an XML object via minidom.parseString(xml_string)

onadata.apps.logger.xform_instance_parser.get_deprecated_uuid_from_xml(xml)

Returns the deprecatedID from submission XML

onadata.apps.logger.xform_instance_parser.get_meta_from_xml(xml_str, meta_name)

Return the meta section of an XForm submission XML.

onadata.apps.logger.xform_instance_parser.get_submission_date_from_xml(xml)

Returns submissionDate from an XML submission.

onadata.apps.logger.xform_instance_parser.get_uuid_from_xml(xml)

Returns the uuid of an XForm submisison XML

onadata.apps.logger.xform_instance_parser.parse_xform_instance(xml_str, data_dictionary)

Parses an XForm submission XML into a flattened python object with additional attributes.

onadata.apps.logger.xform_instance_parser.xform_instance_to_dict(xml_str, data_dictionary)

Parses an XForm submission XML into a python object.

onadata.apps.logger.xform_instance_parser.xform_instance_to_flat_dict(xml_str, data_dictionary)

Parses an XForm submission XML into a flattened python object.

onadata.apps.logger.xform_instance_parser.xpath_from_xml_node(node)

Returns the xpath of an XML node.

Module contents