rinse.util

rinse SOAP client utility functions.

class rinse.util.ElementMaker(typemap=None, namespace=None, nsmap=None, makeelement=None)[source]

Wrapper around lxml ElementMaker that casts ints as strings.

class rinse.util.ElementMakerCache(nsmap)[source]

Cache of ElementMaker instances for the given nsmap.

class rinse.util.RinseResponse(response, doc)
doc

Alias for field number 1

response

Alias for field number 0

class rinse.util.SchemaCache[source]

Cache of lxml.etree.XMLSchema instances, keyed by XSD basename.

get(xsd, xpath=None, namespaces=None)[source]

Generate XMLSchema instances as specified.

class rinse.util.cached_property(func)[source]
rinse.util.element_as_tree(element)[source]

Convert an element from within an ElementTree to its own tree.

rinse.util.printxml(doc)[source]

Pretty print an lxml document tree.

The XML printed may not be exactly equivalent to the doc provided, as blank text within elements will be stripped to allow etree.tostring() to work with the ‘pretty_print’ option set.

rinse.util.recursive_dict(element)[source]

Map an XML tree into a dict of dicts.

rinse.util.safe_parse_path(xml_path, **kwargs)[source]

Safely parse XML content from path into an element tree.

rinse.util.safe_parse_string(raw_xml, **kwargs)[source]

Safely parse raw XML content into an element tree.

rinse.util.safe_parse_url(xml_url, **kwargs)[source]

Safely parse XML content from path into an element tree.