xmlrpclib (version 1.0.1)
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py
Module Docs

An XML-RPC client interface for Python.
 
The marshalling and response parser code can also be used to
implement XML-RPC servers.
 
Exported exceptions:
 
  Error          Base class for client errors
  ProtocolError  Indicates an HTTP protocol error
  ResponseError  Indicates a broken response package
  Fault          Indicates an XML-RPC fault package
 
Exported classes:
 
  ServerProxy    Represents a logical connection to an XML-RPC server
 
  MultiCall      Executor of boxcared xmlrpc requests
  Boolean        boolean wrapper to generate a "boolean" XML-RPC value
  DateTime       dateTime wrapper for an ISO 8601 string or time tuple or
                 localtime integer value to generate a "dateTime.iso8601"
                 XML-RPC value
  Binary         binary data wrapper
 
  SlowParser     Slow but safe standard parser (based on xmllib)
  Marshaller     Generate an XML-RPC params chunk from a Python data structure
  Unmarshaller   Unmarshal an XML-RPC response from incoming XML event message
  Transport      Handles an HTTP transaction to an XML-RPC server
  SafeTransport  Handles an HTTPS transaction to an XML-RPC server
 
Exported constants:
 
  True
  False
 
Exported functions:
 
  boolean        Convert any Python value to an XML-RPC boolean
  getparser      Create instance of the fastest available parser & attach
                 to an unmarshalling object
  dumps          Convert an argument tuple or a Fault instance to an XML-RPC
                 request (or response, if the methodresponse option is used).
  loads          Convert an XML-RPC packet to unmarshalled data plus a method
                 name (None if not present).

 
Modules
       
cStringIO
base64
datetime
errno
xml.parsers.expat
gzip
httplib
operator
re
socket
string
time

 
Classes
       
exceptions.Exception(exceptions.BaseException)
Error
Fault
ProtocolError
ResponseError
gzip.GzipFile(io.BufferedIOBase)
GzipDecodedResponse
Binary
DateTime
ExpatParser
Marshaller
MultiCall
MultiCallIterator
ServerProxy
SlowParser
Transport
SafeTransport
Unmarshaller

 
class Binary
    Wrapper for binary data.
 
  Methods defined here:
__cmp__(self, other)
__init__(self, data=None)
__str__(self)
decode(self, data)
encode(self, out)

 
class DateTime
    DateTime wrapper for an ISO 8601 string or time tuple or
localtime integer value to generate 'dateTime.iso8601' XML-RPC
value.
 
  Methods defined here:
__cmp__(self, other)
__eq__(self, other)
__ge__(self, other)
__gt__(self, other)
__init__(self, value=0)
__le__(self, other)
__lt__(self, other)
__ne__(self, other)
__repr__(self)
__str__(self)
decode(self, data)
encode(self, out)
make_comparable(self, other)
timetuple(self)

 
class Error(exceptions.Exception)
    Base class for client errors.
 
 
Method resolution order:
Error
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__str__(self)

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class ExpatParser
     Methods defined here:
__init__(self, target)
# fast expat parser for Python 2.0 and later.
close(self)
feed(self, data)

 
class Fault(Error)
    Indicates an XML-RPC fault package.
 
 
Method resolution order:
Fault
Error
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, faultCode, faultString, **extra)
__repr__(self)

Methods inherited from Error:
__str__(self)

Data descriptors inherited from Error:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class GzipDecodedResponse(gzip.GzipFile)
    a file-like object to decode a response encoded with the gzip
method, as described in RFC 1952.
 
 
Method resolution order:
GzipDecodedResponse
gzip.GzipFile
io.BufferedIOBase
_io._BufferedIOBase
io.IOBase
_io._IOBase
__builtin__.object

Methods defined here:
__init__(self, response)
close(self)

Data and other attributes defined here:
__abstractmethods__ = frozenset([])

Methods inherited from gzip.GzipFile:
__repr__(self)
fileno(self)
Invoke the underlying file object's fileno() method.
 
This will raise AttributeError if the underlying file object
doesn't support fileno().
flush(self, zlib_mode=2)
read(self, size=-1)
readable(self)
readline(self, size=-1)
rewind(self)
Return the uncompressed stream file position indicator to the
beginning of the file
seek(self, offset, whence=0)
seekable(self)
writable(self)
write(self, data)

Data descriptors inherited from gzip.GzipFile:
closed
filename

Data and other attributes inherited from gzip.GzipFile:
max_read_chunk = 10485760
myfileobj = None

Methods inherited from _io._BufferedIOBase:
detach(...)
Disconnect this buffer from its underlying raw stream and return it.
 
After the raw stream has been detached, the buffer is in an unusable
state.
read1(...)
Read and return up to n bytes, with at most one read() call
to the underlying raw stream. A short result does not imply
that EOF is imminent.
 
Returns an empty bytes object on EOF.
readinto(...)

Data and other attributes inherited from io.IOBase:
__metaclass__ = <class 'abc.ABCMeta'>
Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).

Methods inherited from _io._IOBase:
__enter__(...)
__exit__(...)
__iter__(...)
x.__iter__() <==> iter(x)
isatty(...)
Return whether this is an 'interactive' stream.
 
Return False if it can't be determined.
next(...)
x.next() -> the next value, or raise StopIteration
readlines(...)
Return a list of lines from the stream.
 
hint can be specified to control the number of lines read: no more
lines will be read if the total size (in bytes/characters) of all
lines so far exceeds hint.
tell(...)
Return current stream position.
truncate(...)
Truncate file to size bytes.
 
File pointer is left unchanged.  Size defaults to the current IO
position as reported by tell().  Returns the new size.
writelines(...)

Data and other attributes inherited from _io._IOBase:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class Marshaller
    Generate an XML-RPC params chunk from a Python data structure.
 
Create a Marshaller instance for each set of parameters, and use
the "dumps" method to convert your data (represented as a tuple)
to an XML-RPC params chunk.  To write a fault response, pass a
Fault instance instead.  You may prefer to use the "dumps" module
function for this purpose.
 
  Methods defined here:
__init__(self, encoding=None, allow_none=0)
dump_array(self, value, write)
dump_bool(self, value, write)
dump_datetime(self, value, write)
dump_double(self, value, write)
dump_instance(self, value, write)
dump_int(self, value, write)
dump_long(self, value, write)
dump_nil(self, value, write)
dump_string(self, value, write, escape=<function escape>)
dump_struct(self, value, write, escape=<function escape>)
dump_unicode(self, value, write, escape=<function escape>)
dumps(self, values)

Data and other attributes defined here:
dispatch = {<type 'bool'>: <function dump_bool>, <type 'instance'>: <function dump_instance>, <type 'float'>: <function dump_double>, <type 'int'>: <function dump_int>, <type 'list'>: <function dump_array>, <type 'long'>: <function dump_long>, <type 'dict'>: <function dump_struct>, <type 'NoneType'>: <function dump_nil>, <type 'str'>: <function dump_string>, <type 'tuple'>: <function dump_array>, ...}

 
class MultiCall
    server -> a object used to boxcar method calls
 
server should be a ServerProxy object.
 
Methods can be added to the MultiCall using normal
method call syntax e.g.:
 
multicall = MultiCall(server_proxy)
multicall.add(2,3)
multicall.get_address("Guido")
 
To execute the multicall, call the MultiCall object e.g.:
 
add_result, address = multicall()
 
  Methods defined here:
__call__(self)
__getattr__(self, name)
__init__(self, server)
__repr__(self)
__str__ = __repr__(self)

 
class MultiCallIterator
    Iterates over the results of a multicall. Exceptions are
raised in response to xmlrpc faults.
 
  Methods defined here:
__getitem__(self, i)
__init__(self, results)

 
class ProtocolError(Error)
    Indicates an HTTP protocol error.
 
 
Method resolution order:
ProtocolError
Error
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, url, errcode, errmsg, headers)
__repr__(self)

Methods inherited from Error:
__str__(self)

Data descriptors inherited from Error:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class ResponseError(Error)
    Indicates a broken response package.
 
 
Method resolution order:
ResponseError
Error
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods inherited from Error:
__str__(self)

Data descriptors inherited from Error:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class SafeTransport(Transport)
    Handles an HTTPS transaction to an XML-RPC server.
 
  Methods defined here:
__init__(self, use_datetime=0, context=None)
make_connection(self, host)

Methods inherited from Transport:
close(self)
##
# Clear any cached connection object.
# Used in the event of socket errors.
get_host_info(self, host)
getparser(self)
parse_response(self, response)
request(self, host, handler, request_body, verbose=0)
send_content(self, connection, request_body)
send_host(self, connection, host)
send_request(self, connection, handler, request_body)
send_user_agent(self, connection)
single_request(self, host, handler, request_body, verbose=0)

Data and other attributes inherited from Transport:
accept_gzip_encoding = True
encode_threshold = None
user_agent = 'xmlrpclib.py/1.0.1 (by www.pythonware.com)'

 
Server = class ServerProxy
    uri [,options] -> a logical connection to an XML-RPC server
 
uri is the connection point on the server, given as
scheme://host/target.
 
The standard implementation always supports the "http" scheme.  If
SSL socket support is available (Python 2.0), it also supports
"https".
 
If the target part and the slash preceding it are both omitted,
"/RPC2" is assumed.
 
The following options can be given as keyword arguments:
 
    transport: a transport factory
    encoding: the request encoding (default is UTF-8)
 
All 8-bit strings passed to the server proxy are assumed to use
the given encoding.
 
  Methods defined here:
__call__(self, attr)
A workaround to get special attributes on the ServerProxy
without interfering with the magic __getattr__
__getattr__(self, name)
__init__(self, uri, transport=None, encoding=None, verbose=0, allow_none=0, use_datetime=0, context=None)
__repr__(self)
__str__ = __repr__(self)

 
class ServerProxy
    uri [,options] -> a logical connection to an XML-RPC server
 
uri is the connection point on the server, given as
scheme://host/target.
 
The standard implementation always supports the "http" scheme.  If
SSL socket support is available (Python 2.0), it also supports
"https".
 
If the target part and the slash preceding it are both omitted,
"/RPC2" is assumed.
 
The following options can be given as keyword arguments:
 
    transport: a transport factory
    encoding: the request encoding (default is UTF-8)
 
All 8-bit strings passed to the server proxy are assumed to use
the given encoding.
 
  Methods defined here:
__call__(self, attr)
A workaround to get special attributes on the ServerProxy
without interfering with the magic __getattr__
__getattr__(self, name)
__init__(self, uri, transport=None, encoding=None, verbose=0, allow_none=0, use_datetime=0, context=None)
__repr__(self)
__str__ = __repr__(self)

 
class SlowParser
    Default XML parser (based on xmllib.XMLParser).
 
  Methods defined here:
__init__(self, target)
# this is the slowest parser.

 
class Transport
    Handles an HTTP transaction to an XML-RPC server.
 
  Methods defined here:
__init__(self, use_datetime=0)
close(self)
##
# Clear any cached connection object.
# Used in the event of socket errors.
get_host_info(self, host)
getparser(self)
make_connection(self, host)
parse_response(self, response)
request(self, host, handler, request_body, verbose=0)
send_content(self, connection, request_body)
send_host(self, connection, host)
send_request(self, connection, handler, request_body)
send_user_agent(self, connection)
single_request(self, host, handler, request_body, verbose=0)

Data and other attributes defined here:
accept_gzip_encoding = True
encode_threshold = None
user_agent = 'xmlrpclib.py/1.0.1 (by www.pythonware.com)'

 
class Unmarshaller
    Unmarshal an XML-RPC response, based on incoming XML event
messages (start, data, end).  Call close() to get the resulting
data structure.
 
Note that this reader is fairly tolerant, and gladly accepts bogus
XML-RPC data without complaining (but not bogus XML).
 
  Methods defined here:
__init__(self, use_datetime=0)
close(self)
data(self, text)
end(self, tag, join=<function join>)
end_array(self, data)
end_base64(self, data)
end_boolean(self, data)
end_dateTime(self, data)
end_dispatch(self, tag, data)
end_double(self, data)
end_fault(self, data)
end_int(self, data)
end_methodName(self, data)
end_nil(self, data)
end_params(self, data)
end_string(self, data)
end_struct(self, data)
end_value(self, data)
getmethodname(self)
start(self, tag, attrs)
xml(self, encoding, standalone)

Data and other attributes defined here:
dispatch = {'array': <function end_array>, 'base64': <function end_base64>, 'boolean': <function end_boolean>, 'dateTime.iso8601': <function end_dateTime>, 'double': <function end_double>, 'fault': <function end_fault>, 'i4': <function end_int>, 'i8': <function end_int>, 'int': <function end_int>, 'methodName': <function end_methodName>, ...}

 
Functions
       
dumps(params, methodname=None, methodresponse=None, encoding=None, allow_none=0)
data [,options] -> marshalled data
 
Convert an argument tuple or a Fault instance to an XML-RPC
request (or response, if the methodresponse option is used).
 
In addition to the data object, the following options can be given
as keyword arguments:
 
    methodname: the method name for a methodCall packet
 
    methodresponse: true to create a methodResponse packet.
    If this option is used with a tuple, the tuple must be
    a singleton (i.e. it can contain only one element).
 
    encoding: the packet encoding (default is UTF-8)
 
All 8-bit strings in the data structure are assumed to use the
packet encoding.  Unicode strings are automatically converted,
where necessary.
escape(s, replace=<function replace>)
getparser(use_datetime=0)
getparser() -> parser, unmarshaller
 
Create an instance of the fastest available parser, and attach it
to an unmarshalling object.  Return both objects.
gzip_decode(data, max_decode=20971520)
gzip encoded data -> unencoded data
 
Decode data using the gzip content encoding as described in RFC 1952
gzip_encode(data)
data -> gzip encoded data
 
Encode data using the gzip content encoding as described in RFC 1952
loads(data, use_datetime=0)
data -> unmarshalled data, method name
 
Convert an XML-RPC packet to unmarshalled data plus a method
name (None if not present).
 
If the XML-RPC packet represents a fault condition, this function
raises a Fault exception.

 
Data
        APPLICATION_ERROR = -32500
False = False
FastMarshaller = None
FastParser = None
FastUnmarshaller = None
INTERNAL_ERROR = -32603
INVALID_ENCODING_CHAR = -32702
INVALID_METHOD_PARAMS = -32602
INVALID_XMLRPC = -32600
MAXINT = 2147483647L
METHOD_NOT_FOUND = -32601
MININT = -2147483648L
NOT_WELLFORMED_ERROR = -32700
PARSE_ERROR = -32700
SERVER_ERROR = -32600
SYSTEM_ERROR = -32400
StringTypes = (<type 'str'>, <type 'unicode'>)
TRANSPORT_ERROR = -32300
True = True
UNSUPPORTED_ENCODING = -32701
WRAPPERS = (<class xmlrpclib.DateTime>, <class xmlrpclib.Binary>)
__version__ = '1.0.1'