OCS
For OCS, you should be able to use COM scripting to do most but not all[1] things. The code should look a bit like this:
import win32com.client
def get_contact(signin_uri, communicator):
c = communicator.GetContact(signin_uri, communicator.MyServiceId)
return c
comm = win32com.client.Dispatch('Communicator.UIAutomation')
contact = get_contact("[email protected]", comm)
You should be able to translate the documentation from the API fairly easily, especially if you focus on the JScript examples.
MSN/Live, AIM, ICQ, and IRC
For MSN/Live Messenger, the excellent twisted library contains an rudimentary implementation of a multiprotocol IM client (and server). To get started, check out some code samples.
[1] From the documentation:
For reasons of security, not all
methods or properties can be called
using JavaScript or another scripting
language. Such restrictions are
documented in Office Communicator Automation API Reference.