Module xmlrpclib
[hide private]
[frames] | no frames]

Module xmlrpclib

source code


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).




Version: 1.0.1

Classes [hide private]
  Binary
Wrapper for binary data.
  DateTime
DateTime wrapper for an ISO 8601 string or time tuple or localtime integer value to generate 'dateTime.iso8601' XML-RPC value.
  Error
Base class for client errors.
  ExpatParser
  Fault
Indicates an XML-RPC fault package.
  Marshaller
Generate an XML-RPC params chunk from a Python data structure.
  MultiCall
server -> a object used to boxcar method calls
  MultiCallIterator
Iterates over the results of a multicall.
  ProtocolError
Indicates an HTTP protocol error.
  ResponseError
Indicates a broken response package.
  SafeTransport
Handles an HTTPS transaction to an XML-RPC server.
  Server
uri [,options] -> a logical connection to an XML-RPC server uri is the connection point on the server, given as scheme://host/target.
  ServerProxy
uri [,options] -> a logical connection to an XML-RPC server uri is the connection point on the server, given as scheme://host/target.
  SlowParser
Default XML parser (based on xmllib.XMLParser).
  Transport
Handles an HTTP transaction to an XML-RPC server.
  Unmarshaller
Unmarshal an XML-RPC response, based on incoming XML event messages (start, data, end).
  _Method
  _MultiCallMethod
Functions [hide private]
 
_binary(data) source code
 
_datetime(data) source code
 
_datetime_type(data) source code
 
_decode(data, encoding, is8bit=<built-in method search of _sre.SRE_Pattern object at 0xab96b8>) source code
 
_stringify(string) source code
 
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).
source code
 
escape(s, replace=<function replace at 0x7f806f3447d0>) source code
 
getparser()
Create an instance of the fastest available parser, and attach it to an unmarshalling object.
source code
 
loads(data, use_datetime=0)
data -> unmarshalled data, method name
source code
Variables [hide private]
  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 = 2147483647
  METHOD_NOT_FOUND = -32601
  MININT = -2147483648
  NOT_WELLFORMED_ERROR = -32700
  PARSE_ERROR = -32700
  SERVER_ERROR = -32600
  SYSTEM_ERROR = -32400
  SgmlopParser = None
  StringTypes = (<type 'str'>, <type 'unicode'>)
  TRANSPORT_ERROR = -32300
  True = True
  UNSUPPORTED_ENCODING = -32701
  WRAPPERS = (<class xmlrpclib.DateTime at 0xb1f230>, <class xml...
  _bool_is_builtin = True
Function Details [hide private]

dumps(params, methodname=None, methodresponse=None, encoding=None, allow_none=0)

source code 
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.

getparser()

source code 
Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects.
Returns:
parser, unmarshaller

loads(data, use_datetime=0)

source code 

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.

Variables Details [hide private]

WRAPPERS

Value:
(<class xmlrpclib.DateTime at 0xb1f230>,
 <class xmlrpclib.Binary at 0xb1f4d0>)