suds.umx package¶
Submodules¶
suds.umx.attrlist module¶
Provides filtered attribute list classes.
- class suds.umx.attrlist.AttrList(attributes)¶
Bases:
objectA filtered attribute list. Items are included during iteration if they are in either the (xs) or (xml) namespaces. :ivar raw: The
rawattribute list. :type raw: list- lang()¶
Get list of
filteredattributes which exclude xs. :return: A list offilteredattributes. :rtype:generator
- real()¶
Get list of
realattributes which exclude xs and xml attributes. :return: A list ofrealattributes. :rtype:generator
- rlen()¶
Get the number of
realattributes which exclude xs and xml attributes. :return: A count ofrealattributes. :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.
suds.umx.core module¶
Provides base classes for XML->object unmarshalling.
- class suds.umx.core.Core¶
Bases:
objectThe abstract XML
nodeunmarshaller. This class provides thecoreunmarshalling functionality.- append(content)¶
Process the specified node and convert the XML document into a
sudsobject. :param content: The current content being unmarshalled. :type content:Content:return: Aappend-resulttuple 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 theschemaorxmlnamespaces 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
nodehas 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
nodehas 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:
TypedA SOAP section (5) encoding unmarshaller. This marshaller supports rpc/encoded soap styles.
- applyaty(content, xty)¶
Apply the type referenced in the
arrayTypeto 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 thearrayType. :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
nodehas 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
nodehas 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:
CoreA
typedXML 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.dataHere is where thetruetype 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
nodehas 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: Theoptionalschema type. :type type:xsd.sxbase.SchemaObject:return: A suds object. :rtype:Object
- reset()¶
- start(content)¶
Processing on
nodehas 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).