Client

The Client class is the gateway to your WordPress blog’s XML-RPC interface.

Once initialized with your blog URL and user credentials, the client object is ready to execute XML-RPC methods against your WordPress blog using its Client.call() method.

Client

class Client(url, username, password[, blog_id, transport])
Parameters:
  • url – URL of the blog’s XML-RPC endpoint (e.g., http://www.example.com/xmlrpc.php)
  • username – Username of a valid user account on the WordPress blog
  • password – The password for this user account
  • blog_id – The blog’s ID (note: WordPress ignores this value, but it is retained for backwards compatibility)
  • transport – Custom XML-RPC transport implementation. See Python2 or Python3 documentation.
call(method)
Parameters:methodwordpress_xmlrpc.XmlrpcMethod-derived class

XML-RPC Method Classes

Library to interface with the WordPress XML-RPC API.

See README for usage instructions.

class wordpress_xmlrpc.XmlrpcMethod

Base class for XML-RPC methods.

Child classes can override methods and properties to customize behavior:

Properties:
  • method_name: XML-RPC method name (e.g., ‘wp.getUserInfo’)
  • method_args: Tuple of method-specific required parameters
  • optional_args: Tuple of method-specific optional parameters
  • results_class: Python class which will convert an XML-RPC response dict into an object
default_args(client)

Builds set of method-non-specific arguments.

get_args(client)

Builds final set of XML-RPC method arguments based on the method’s arguments, any default arguments, and their defined respective ordering.

process_result(raw_result)

Performs actions on the raw result from the XML-RPC response.

If a results_class is defined, the response will be converted into one or more object instances of that class.

class wordpress_xmlrpc.AnonymousMethod

An XML-RPC method for which no authentication is required.

class wordpress_xmlrpc.AuthenticatedMethod

An XML-RPC method for which user authentication is required.

Blog ID, username and password details will be passed from the Client instance to the method call.