suds.umx package

Submodules

suds.umx.attrlist module

Provides filtered attribute list classes.

class suds.umx.attrlist.AttrList(attributes)

Bases: object

A filtered attribute list. Items are included during iteration if they are in either the (xs) or (xml) namespaces. :ivar raw: The raw attribute list. :type raw: list

lang()

Get list of filtered attributes which exclude xs. :return: A list of filtered attributes. :rtype: generator

real()

Get list of real attributes which exclude xs and xml attributes. :return: A list of real attributes. :rtype: generator

rlen()

Get the number of real attributes which exclude xs and xml attributes. :return: A count of real attributes. :rtype: int

skip(attr)

Get whether to skip (filter-out) the specified attribute. :param attr: An attribute. :type attr: Attribute :return: True if should be skipped. :rtype: bool

suds.umx.basic module

Provides basic unmarshaller classes.

class suds.umx.basic.Basic

Bases: Core

A object builder (unmarshaller).

process(node)

Process an object graph representation of the xml node. :param node: An XML tree. :type node: sax.element.Element :return: A suds object. :rtype: Object

suds.umx.core module

Provides base classes for XML->object unmarshalling.

class suds.umx.core.Core

Bases: object

The abstract XML node unmarshaller. This class provides the core unmarshalling functionality.

append(content)

Process the specified node and convert the XML document into a suds object. :param content: The current content being unmarshalled. :type content: Content :return: A append-result tuple as: (Object, value) :rtype: append-result @note: This is not the proper entry point. @see: process()

append_attribute(name, value, content)

Append an attribute name/value into Content.data. :param name: The attribute name :type name: basestring :param value: The attribute’s value :type value: basestring :param content: The current content being unmarshalled. :type content: Content

append_attributes(content)

Append attribute nodes into Content.data. Attributes in the schema or xml namespaces are skipped. :param content: The current content being unmarshalled. :type content: Content

append_children(content)

Append child nodes into Content.data :param content: The current content being unmarshalled. :type content: Content

append_text(content)

Append text nodes into Content.data :param content: The current content being unmarshalled. :type content: Content

end(content)

Processing on node has ended. :param content: The current content being unmarshalled. :type content: Content

multi_occurrence(content)

Get whether the content has more than one occurrence (a list). :param content: The current content being unmarshalled. :type content: Content :return: True if content has more than one occurrence, else False. :rtype: boolean ‘

nillable(content)

Get whether the object is nillable. :param content: The current content being unmarshalled. :type content: Content :return: True if nillable, else False :rtype: boolean ‘

postprocess(content)
Perform final processing of the resulting data structure as follows:
  • Mixed values (children and text) will have a result of the content.node.

  • Simi-simple values (attributes, no-children and text) will have a result of a

    property object.

  • Simple values (no-attributes, no-children with text nodes) will have a string

    result equal to the value of the content.node.getText().

Parameters:

content (Content) – The current content being unmarshalled.

Returns:

The post-processed result.

Return type:

any

process(content)

Process an object graph representation of the xml node. :param content: The current content being unmarshalled. :type content: Content :return: A suds object. :rtype: Object

reset()
single_occurrence(content)

Get whether the content has at most a single occurrence (not a list). :param content: The current content being unmarshalled. :type content: Content :return: True if content has at most a single occurrence, else False. :rtype: boolean ‘

start(content)

Processing on node has started. Build and return the proper object. :param content: The current content being unmarshalled. :type content: Content :return: A subclass of Object. :rtype: Object

suds.umx.encoded module

Provides soap encoded unmarshaller classes.

class suds.umx.encoded.Encoded(schema)

Bases: Typed

A SOAP section (5) encoding unmarshaller. This marshaller supports rpc/encoded soap styles.

applyaty(content, xty)

Apply the type referenced in the arrayType to the content (child nodes) of the array. Each element (node) in the array that does not have an explicit xsi:type attribute is given one based on the arrayType. :param content: An array content. :type content: Content :param xty: The XSI type reference. :type xty: str :return: self :rtype: Encoded

end(content)

Processing on node has ended. :param content: The current content being unmarshalled. :type content: Content

postprocess(content)
Perform final processing of the resulting data structure as follows:
  • Mixed values (children and text) will have a result of the content.node.

  • Simi-simple values (attributes, no-children and text) will have a result of a

    property object.

  • Simple values (no-attributes, no-children with text nodes) will have a string

    result equal to the value of the content.node.getText().

Parameters:

content (Content) – The current content being unmarshalled.

Returns:

The post-processed result.

Return type:

any

promote(content)

Promote (replace) the content.data with the first attribute of the current content.data that is a list. Note: the content.data may be empty or contain only _x attributes. In either case, the content.data is assigned an empty list. :param content: An array content. :type content: Content

setaty(content)

Grab the (aty) soap-enc:arrayType and attach it to the content for proper array processing later in end(). :param content: The current content being unmarshalled. :type content: Content :return: self :rtype: Encoded

start(content)

Processing on node has started. Build and return the proper object. :param content: The current content being unmarshalled. :type content: Content :return: A subclass of Object. :rtype: Object

suds.umx.typed module

Provides typed unmarshaller classes.

class suds.umx.typed.Typed(schema)

Bases: Core

A typed XML unmarshaller :ivar resolver: A schema type resolver. :type resolver: NodeResolver

append_attribute(name, value, content)

Append an attribute name/value into Content.data. :param name: The attribute name :type name: basestring :param value: The attribute’s value :type value: basestring :param content: The current content being unmarshalled. :type content: Content

append_text(content)

Append text nodes into Content.data Here is where the true type is used to translate the value into the proper python type. :param content: The current content being unmarshalled. :type content: Content

end(content)

Processing on node has ended. :param content: The current content being unmarshalled. :type content: Content

multi_occurrence(content)

Get whether the content has more than one occurrence (a list). :param content: The current content being unmarshalled. :type content: Content :return: True if content has more than one occurrence, else False. :rtype: boolean ‘

nillable(content)

Get whether the object is nillable. :param content: The current content being unmarshalled. :type content: Content :return: True if nillable, else False :rtype: boolean ‘

process(node, type)

Process an object graph representation of the xml node. :param node: An XML tree. :type node: sax.element.Element :param type: The optional schema type. :type type: xsd.sxbase.SchemaObject :return: A suds object. :rtype: Object

reset()
start(content)

Processing on node has started. Build and return the proper object. :param content: The current content being unmarshalled. :type content: Content :return: A subclass of Object. :rtype: Object

translated(value, type)

translate using the schema type

Module contents

Provides modules containing classes to support unmarshalling (XML).

class suds.umx.Content(node, **kwargs)

Bases: Object

Variables:
  • node – The content source node.

  • data – The (optional) content data.

  • text – The (optional) content (xml) text.

extensions = ['type', 'real', 'aty']