doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
wsgiref.validate.validator(application) Wrap application and return a new WSGI application object. The returned application will forward all requests to the original application, and will check that both the application and the server invoking it are conforming to the WSGI specification and to RFC 2616. Any detected ...
python.library.wsgiref#wsgiref.validate.validator
xdrlib — Encode and decode XDR data Source code: Lib/xdrlib.py The xdrlib module supports the External Data Representation Standard as described in RFC 1014, written by Sun Microsystems, Inc. June 1987. It supports most of the data types described in the RFC. The xdrlib module defines two classes, one for packing varia...
python.library.xdrlib
exception xdrlib.ConversionError Class derived from Error. Contains no additional instance variables.
python.library.xdrlib#xdrlib.ConversionError
exception xdrlib.Error The base exception class. Error has a single public attribute msg containing the description of the error.
python.library.xdrlib#xdrlib.Error
class xdrlib.Packer Packer is the class for packing data into XDR representation. The Packer class is instantiated with no arguments.
python.library.xdrlib#xdrlib.Packer
Packer.get_buffer() Returns the current pack buffer as a string.
python.library.xdrlib#xdrlib.Packer.get_buffer
Packer.pack_array(list, pack_item) Packs a variable length list of homogeneous items. First, the length of the list is packed as an unsigned integer, then each element is packed as in pack_farray() above.
python.library.xdrlib#xdrlib.Packer.pack_array
Packer.pack_bytes(bytes) Packs a variable length byte stream, similarly to pack_string().
python.library.xdrlib#xdrlib.Packer.pack_bytes
Packer.pack_double(value) Packs the double-precision floating point number value.
python.library.xdrlib#xdrlib.Packer.pack_double
Packer.pack_farray(n, array, pack_item) Packs a fixed length list (array) of homogeneous items. n is the length of the list; it is not packed into the buffer, but a ValueError exception is raised if len(array) is not equal to n. As above, pack_item is the function used to pack each element.
python.library.xdrlib#xdrlib.Packer.pack_farray
Packer.pack_float(value) Packs the single-precision floating point number value.
python.library.xdrlib#xdrlib.Packer.pack_float
Packer.pack_fopaque(n, data) Packs a fixed length opaque data stream, similarly to pack_fstring().
python.library.xdrlib#xdrlib.Packer.pack_fopaque
Packer.pack_fstring(n, s) Packs a fixed length string, s. n is the length of the string but it is not packed into the data buffer. The string is padded with null bytes if necessary to guaranteed 4 byte alignment.
python.library.xdrlib#xdrlib.Packer.pack_fstring
Packer.pack_list(list, pack_item) Packs a list of homogeneous items. This method is useful for lists with an indeterminate size; i.e. the size is not available until the entire list has been walked. For each item in the list, an unsigned integer 1 is packed first, followed by the data value from the list. pack_item i...
python.library.xdrlib#xdrlib.Packer.pack_list
Packer.pack_opaque(data) Packs a variable length opaque data string, similarly to pack_string().
python.library.xdrlib#xdrlib.Packer.pack_opaque
Packer.pack_string(s) Packs a variable length string, s. The length of the string is first packed as an unsigned integer, then the string data is packed with pack_fstring().
python.library.xdrlib#xdrlib.Packer.pack_string
Packer.reset() Resets the pack buffer to the empty string.
python.library.xdrlib#xdrlib.Packer.reset
class xdrlib.Unpacker(data) Unpacker is the complementary class which unpacks XDR data values from a string buffer. The input buffer is given as data.
python.library.xdrlib#xdrlib.Unpacker
Unpacker.done() Indicates unpack completion. Raises an Error exception if all of the data has not been unpacked.
python.library.xdrlib#xdrlib.Unpacker.done
Unpacker.get_buffer() Returns the current unpack data buffer as a string.
python.library.xdrlib#xdrlib.Unpacker.get_buffer
Unpacker.get_position() Returns the current unpack position in the data buffer.
python.library.xdrlib#xdrlib.Unpacker.get_position
Unpacker.reset(data) Resets the string buffer with the given data.
python.library.xdrlib#xdrlib.Unpacker.reset
Unpacker.set_position(position) Sets the data buffer unpack position to position. You should be careful about using get_position() and set_position().
python.library.xdrlib#xdrlib.Unpacker.set_position
Unpacker.unpack_array(unpack_item) Unpacks and returns a variable length list of homogeneous items. First, the length of the list is unpacked as an unsigned integer, then each element is unpacked as in unpack_farray() above.
python.library.xdrlib#xdrlib.Unpacker.unpack_array
Unpacker.unpack_bytes() Unpacks and returns a variable length byte stream, similarly to unpack_string().
python.library.xdrlib#xdrlib.Unpacker.unpack_bytes
Unpacker.unpack_double() Unpacks a double-precision floating point number, similarly to unpack_float().
python.library.xdrlib#xdrlib.Unpacker.unpack_double
Unpacker.unpack_farray(n, unpack_item) Unpacks and returns (as a list) a fixed length array of homogeneous items. n is number of list elements to expect in the buffer. As above, unpack_item is the function used to unpack each element.
python.library.xdrlib#xdrlib.Unpacker.unpack_farray
Unpacker.unpack_float() Unpacks a single-precision floating point number.
python.library.xdrlib#xdrlib.Unpacker.unpack_float
Unpacker.unpack_fopaque(n) Unpacks and returns a fixed length opaque data stream, similarly to unpack_fstring().
python.library.xdrlib#xdrlib.Unpacker.unpack_fopaque
Unpacker.unpack_fstring(n) Unpacks and returns a fixed length string. n is the number of characters expected. Padding with null bytes to guaranteed 4 byte alignment is assumed.
python.library.xdrlib#xdrlib.Unpacker.unpack_fstring
Unpacker.unpack_list(unpack_item) Unpacks and returns a list of homogeneous items. The list is unpacked one element at a time by first unpacking an unsigned integer flag. If the flag is 1, then the item is unpacked and appended to the list. A flag of 0 indicates the end of the list. unpack_item is the function that i...
python.library.xdrlib#xdrlib.Unpacker.unpack_list
Unpacker.unpack_opaque() Unpacks and returns a variable length opaque data string, similarly to unpack_string().
python.library.xdrlib#xdrlib.Unpacker.unpack_opaque
Unpacker.unpack_string() Unpacks and returns a variable length string. The length of the string is first unpacked as an unsigned integer, then the string data is unpacked with unpack_fstring().
python.library.xdrlib#xdrlib.Unpacker.unpack_string
xml.dom — The Document Object Model API Source code: Lib/xml/dom/__init__.py The Document Object Model, or “DOM,” is a cross-language API from the World Wide Web Consortium (W3C) for accessing and modifying XML documents. A DOM implementation presents an XML document as a tree structure, or allows client code to build ...
python.library.xml.dom
Attr.localName The part of the name following the colon if there is one, else the entire name. This is a read-only attribute.
python.library.xml.dom#xml.dom.Attr.localName
Attr.name The attribute name. In a namespace-using document it may include a colon.
python.library.xml.dom#xml.dom.Attr.name
Attr.prefix The part of the name preceding the colon if there is one, else the empty string.
python.library.xml.dom#xml.dom.Attr.prefix
Attr.value The text value of the attribute. This is a synonym for the nodeValue attribute.
python.library.xml.dom#xml.dom.Attr.value
Comment.data The content of the comment as a string. The attribute contains all characters between the leading <!-- and trailing -->, but does not include them.
python.library.xml.dom#xml.dom.Comment.data
Document.createAttribute(name) Create and return an attribute node. This method does not associate the attribute node with any particular element. You must use setAttributeNode() on the appropriate Element object to use the newly created attribute instance.
python.library.xml.dom#xml.dom.Document.createAttribute
Document.createAttributeNS(namespaceURI, qualifiedName) Create and return an attribute node with a namespace. The tagName may have a prefix. This method does not associate the attribute node with any particular element. You must use setAttributeNode() on the appropriate Element object to use the newly created attribu...
python.library.xml.dom#xml.dom.Document.createAttributeNS
Document.createComment(data) Create and return a comment node containing the data passed as a parameter. As with the other creation methods, this one does not insert the node into the tree.
python.library.xml.dom#xml.dom.Document.createComment
Document.createElement(tagName) Create and return a new element node. The element is not inserted into the document when it is created. You need to explicitly insert it with one of the other methods such as insertBefore() or appendChild().
python.library.xml.dom#xml.dom.Document.createElement
Document.createElementNS(namespaceURI, tagName) Create and return a new element with a namespace. The tagName may have a prefix. The element is not inserted into the document when it is created. You need to explicitly insert it with one of the other methods such as insertBefore() or appendChild().
python.library.xml.dom#xml.dom.Document.createElementNS
Document.createProcessingInstruction(target, data) Create and return a processing instruction node containing the target and data passed as parameters. As with the other creation methods, this one does not insert the node into the tree.
python.library.xml.dom#xml.dom.Document.createProcessingInstruction
Document.createTextNode(data) Create and return a text node containing the data passed as a parameter. As with the other creation methods, this one does not insert the node into the tree.
python.library.xml.dom#xml.dom.Document.createTextNode
Document.documentElement The one and only root element of the document.
python.library.xml.dom#xml.dom.Document.documentElement
Document.getElementsByTagName(tagName) Search for all descendants (direct children, children’s children, etc.) with a particular element type name.
python.library.xml.dom#xml.dom.Document.getElementsByTagName
Document.getElementsByTagNameNS(namespaceURI, localName) Search for all descendants (direct children, children’s children, etc.) with a particular namespace URI and localname. The localname is the part of the namespace after the prefix.
python.library.xml.dom#xml.dom.Document.getElementsByTagNameNS
DocumentType.entities This is a NamedNodeMap giving the definitions of external entities. For entity names defined more than once, only the first definition is provided (others are ignored as required by the XML recommendation). This may be None if the information is not provided by the parser, or if no entities are ...
python.library.xml.dom#xml.dom.DocumentType.entities
DocumentType.internalSubset A string giving the complete internal subset from the document. This does not include the brackets which enclose the subset. If the document has no internal subset, this should be None.
python.library.xml.dom#xml.dom.DocumentType.internalSubset
DocumentType.name The name of the root element as given in the DOCTYPE declaration, if present.
python.library.xml.dom#xml.dom.DocumentType.name
DocumentType.notations This is a NamedNodeMap giving the definitions of notations. For notation names defined more than once, only the first definition is provided (others are ignored as required by the XML recommendation). This may be None if the information is not provided by the parser, or if no notations are defi...
python.library.xml.dom#xml.dom.DocumentType.notations
DocumentType.publicId The public identifier for the external subset of the document type definition. This will be a string or None.
python.library.xml.dom#xml.dom.DocumentType.publicId
DocumentType.systemId The system identifier for the external subset of the document type definition. This will be a URI as a string, or None.
python.library.xml.dom#xml.dom.DocumentType.systemId
exception xml.dom.DOMException Base exception class used for all specific DOM exceptions. This exception class cannot be directly instantiated.
python.library.xml.dom#xml.dom.DOMException
DOMImplementation.createDocument(namespaceUri, qualifiedName, doctype) Return a new Document object (the root of the DOM), with a child Element object having the given namespaceUri and qualifiedName. The doctype must be a DocumentType object created by createDocumentType(), or None. In the Python DOM API, the first t...
python.library.xml.dom#xml.dom.DOMImplementation.createDocument
DOMImplementation.createDocumentType(qualifiedName, publicId, systemId) Return a new DocumentType object that encapsulates the given qualifiedName, publicId, and systemId strings, representing the information contained in an XML document type declaration.
python.library.xml.dom#xml.dom.DOMImplementation.createDocumentType
DOMImplementation.hasFeature(feature, version) Return True if the feature identified by the pair of strings feature and version is implemented.
python.library.xml.dom#xml.dom.DOMImplementation.hasFeature
exception xml.dom.DomstringSizeErr Raised when a specified range of text does not fit into a string. This is not known to be used in the Python DOM implementations, but may be received from DOM implementations not written in Python.
python.library.xml.dom#xml.dom.DomstringSizeErr
Element.getAttribute(name) Return the value of the attribute named by name as a string. If no such attribute exists, an empty string is returned, as if the attribute had no value.
python.library.xml.dom#xml.dom.Element.getAttribute
Element.getAttributeNode(attrname) Return the Attr node for the attribute named by attrname.
python.library.xml.dom#xml.dom.Element.getAttributeNode
Element.getAttributeNodeNS(namespaceURI, localName) Return an attribute value as a node, given a namespaceURI and localName.
python.library.xml.dom#xml.dom.Element.getAttributeNodeNS
Element.getAttributeNS(namespaceURI, localName) Return the value of the attribute named by namespaceURI and localName as a string. If no such attribute exists, an empty string is returned, as if the attribute had no value.
python.library.xml.dom#xml.dom.Element.getAttributeNS
Element.getElementsByTagName(tagName) Same as equivalent method in the Document class.
python.library.xml.dom#xml.dom.Element.getElementsByTagName
Element.getElementsByTagNameNS(namespaceURI, localName) Same as equivalent method in the Document class.
python.library.xml.dom#xml.dom.Element.getElementsByTagNameNS
Element.hasAttribute(name) Return True if the element has an attribute named by name.
python.library.xml.dom#xml.dom.Element.hasAttribute
Element.hasAttributeNS(namespaceURI, localName) Return True if the element has an attribute named by namespaceURI and localName.
python.library.xml.dom#xml.dom.Element.hasAttributeNS
Element.removeAttribute(name) Remove an attribute by name. If there is no matching attribute, a NotFoundErr is raised.
python.library.xml.dom#xml.dom.Element.removeAttribute
Element.removeAttributeNode(oldAttr) Remove and return oldAttr from the attribute list, if present. If oldAttr is not present, NotFoundErr is raised.
python.library.xml.dom#xml.dom.Element.removeAttributeNode
Element.removeAttributeNS(namespaceURI, localName) Remove an attribute by name. Note that it uses a localName, not a qname. No exception is raised if there is no matching attribute.
python.library.xml.dom#xml.dom.Element.removeAttributeNS
Element.setAttribute(name, value) Set an attribute value from a string.
python.library.xml.dom#xml.dom.Element.setAttribute
Element.setAttributeNode(newAttr) Add a new attribute node to the element, replacing an existing attribute if necessary if the name attribute matches. If a replacement occurs, the old attribute node will be returned. If newAttr is already in use, InuseAttributeErr will be raised.
python.library.xml.dom#xml.dom.Element.setAttributeNode
Element.setAttributeNodeNS(newAttr) Add a new attribute node to the element, replacing an existing attribute if necessary if the namespaceURI and localName attributes match. If a replacement occurs, the old attribute node will be returned. If newAttr is already in use, InuseAttributeErr will be raised.
python.library.xml.dom#xml.dom.Element.setAttributeNodeNS
Element.setAttributeNS(namespaceURI, qname, value) Set an attribute value from a string, given a namespaceURI and a qname. Note that a qname is the whole attribute name. This is different than above.
python.library.xml.dom#xml.dom.Element.setAttributeNS
Element.tagName The element type name. In a namespace-using document it may have colons in it. The value is a string.
python.library.xml.dom#xml.dom.Element.tagName
xml.dom.EMPTY_NAMESPACE The value used to indicate that no namespace is associated with a node in the DOM. This is typically found as the namespaceURI of a node, or used as the namespaceURI parameter to a namespaces-specific method.
python.library.xml.dom#xml.dom.EMPTY_NAMESPACE
xml.dom.getDOMImplementation(name=None, features=()) Return a suitable DOM implementation. The name is either well-known, the module name of a DOM implementation, or None. If it is not None, imports the corresponding module and returns a DOMImplementation object if the import succeeds. If no name is given, and if the...
python.library.xml.dom#xml.dom.getDOMImplementation
exception xml.dom.HierarchyRequestErr Raised when an attempt is made to insert a node where the node type is not allowed.
python.library.xml.dom#xml.dom.HierarchyRequestErr
exception xml.dom.IndexSizeErr Raised when an index or size parameter to a method is negative or exceeds the allowed values.
python.library.xml.dom#xml.dom.IndexSizeErr
exception xml.dom.InuseAttributeErr Raised when an attempt is made to insert an Attr node that is already present elsewhere in the document.
python.library.xml.dom#xml.dom.InuseAttributeErr
exception xml.dom.InvalidAccessErr Raised if a parameter or an operation is not supported on the underlying object.
python.library.xml.dom#xml.dom.InvalidAccessErr
exception xml.dom.InvalidCharacterErr This exception is raised when a string parameter contains a character that is not permitted in the context it’s being used in by the XML 1.0 recommendation. For example, attempting to create an Element node with a space in the element type name will cause this error to be raised.
python.library.xml.dom#xml.dom.InvalidCharacterErr
exception xml.dom.InvalidModificationErr Raised when an attempt is made to modify the type of a node.
python.library.xml.dom#xml.dom.InvalidModificationErr
exception xml.dom.InvalidStateErr Raised when an attempt is made to use an object that is not defined or is no longer usable.
python.library.xml.dom#xml.dom.InvalidStateErr
xml.dom.minidom — Minimal DOM implementation Source code: Lib/xml/dom/minidom.py xml.dom.minidom is a minimal implementation of the Document Object Model interface, with an API similar to that in other languages. It is intended to be simpler than the full DOM and also significantly smaller. Users who are not already pr...
python.library.xml.dom.minidom
Node.toprettyxml(indent="\t", newl="\n", encoding=None, standalone=None) Return a pretty-printed version of the document. indent specifies the indentation string and defaults to a tabulator; newl specifies the string emitted at the end of each line and defaults to \n. The encoding argument behaves like the correspond...
python.library.xml.dom.minidom#xml.dom.minidom.Node.toprettyxml
Node.toxml(encoding=None, standalone=None) Return a string or byte string containing the XML represented by the DOM node. With an explicit encoding 1 argument, the result is a byte string in the specified encoding. With no encoding argument, the result is a Unicode string, and the XML declaration in the resulting str...
python.library.xml.dom.minidom#xml.dom.minidom.Node.toxml
Node.unlink() Break internal references within the DOM so that it will be garbage collected on versions of Python without cyclic GC. Even when cyclic GC is available, using this can make large amounts of memory available sooner, so calling this on DOM objects as soon as they are no longer needed is good practice. Thi...
python.library.xml.dom.minidom#xml.dom.minidom.Node.unlink
Node.writexml(writer, indent="", addindent="", newl="", encoding=None, standalone=None) Write XML to the writer object. The writer receives texts but not bytes as input, it should have a write() method which matches that of the file object interface. The indent parameter is the indentation of the current node. The ad...
python.library.xml.dom.minidom#xml.dom.minidom.Node.writexml
xml.dom.minidom.parse(filename_or_file, parser=None, bufsize=None) Return a Document from the given input. filename_or_file may be either a file name, or a file-like object. parser, if given, must be a SAX2 parser object. This function will change the document handler of the parser and activate namespace support; oth...
python.library.xml.dom.minidom#xml.dom.minidom.parse
xml.dom.minidom.parseString(string, parser=None) Return a Document that represents the string. This method creates an io.StringIO object for the string and passes that on to parse().
python.library.xml.dom.minidom#xml.dom.minidom.parseString
NamedNodeMap.item(index) Return an attribute with a particular index. The order you get the attributes in is arbitrary but will be consistent for the life of a DOM. Each item is an attribute node. Get its value with the value attribute.
python.library.xml.dom#xml.dom.NamedNodeMap.item
NamedNodeMap.length The length of the attribute list.
python.library.xml.dom#xml.dom.NamedNodeMap.length
exception xml.dom.NamespaceErr If an attempt is made to change any object in a way that is not permitted with regard to the Namespaces in XML recommendation, this exception is raised.
python.library.xml.dom#xml.dom.NamespaceErr
exception xml.dom.NoDataAllowedErr This is raised if data is specified for a node which does not support data.
python.library.xml.dom#xml.dom.NoDataAllowedErr
Node.appendChild(newChild) Add a new child node to this node at the end of the list of children, returning newChild. If the node was already in the tree, it is removed first.
python.library.xml.dom#xml.dom.Node.appendChild
Node.attributes A NamedNodeMap of attribute objects. Only elements have actual values for this; others provide None for this attribute. This is a read-only attribute.
python.library.xml.dom#xml.dom.Node.attributes
Node.childNodes A list of nodes contained within this node. This is a read-only attribute.
python.library.xml.dom#xml.dom.Node.childNodes
Node.cloneNode(deep) Clone this node. Setting deep means to clone all child nodes as well. This returns the clone.
python.library.xml.dom#xml.dom.Node.cloneNode