This isn't the place to ask this and your intentions aren't exactly clear. Do you want to make a plugin for Pidgin in python? Do you want to make a plugin for other apps that interface with Pidgin? If it's the latter, yes. Pidgin can communicate to other applications via D-Bus. Just have your python script talk to Pidgin through D-Bus and do what you want it to do.