xmlrpclib is the Python standard library module for transparently handling XML Remote Procedure Call. (Available since v2.2)
xmlrpclib is the Python standard library module for handling XML Remote Procedure Call. It has been available since Python 2.2, and is capable of sending the following types of data:
- Booleans
- Numbers
- Strings
- Arrays
- Dicts
- Dates
- Binary data
The library's main class, ServerProxy
, transparently calls its methods across a network, without having to use any special syntax. For example,
proxy = xmlrpclib.ServerProxy("http://www.example.com/rpc-example")
x = proxy.stdev([1,2,3,4,5])
will, behind the scenes, do this:
Transmit a call to the
stdev
method (along with arguments, changed into XML RPC format) across the network, to the XML RPC server at "http://www.example.com/rpc-example".The server will read the command respond with the results of the call.
The
proxy
object will read the results.The results will be cast from XML RPC format into a native Python object, and returned.
The Python documentation site hosts the xmlrpclib
documentation.