Doug Fort of Downright Software recently announced pyagent, an XML-RPC infrastructure for independent agents. Agents, semi-autonomous programs that can perform tasks for you or make decisions for you, may act as either a server or client. Intelligent agents are a basic building block of peer-to-peer systems. The Peer-to-Peer Working Group describes them this way:
Peer to peer computing [..] allows computing networks to dynamically work together using intelligent agents. Agents reside on peer computers and communicate various kinds of information back and forth. Agents may also initiate tasks on behalf of other peer systems.
While the pyagent framework doesn't supply the intelligence, it does supply a simple means for agents to communicate. To find and communicate with each others, agents register with a locator agent. That is about the extent of the framework. Agents, including the locator agent, speak to each other using XML-RPC. Pyagent includes an example application, a chat program. It isn't very agent-like, but it does demonstrate how pyagent works.
Pyagent's simplicity will appeal to those who need a simple communication framework and for those just beginning to learn both python and P2P programming. Building on Fredrick Lundh's xmlrpc library the pyagent team wrote the framework in less than 300 lines of code. They also include their unit tests with the source, a bonus for those learning about unit testing.
As I was preparing this article, Downright announced pyagent 1.0. This full release version includes an enhanced chat example with a bot that posts Meerkat news headlines to the chat session. Even more reason to check it out.
Stephen Figgins administrates Linux servers for Sunflower Broadband, a cable company.
Read more Python News columns.
Return to the Python DevCenter.
Copyright © 2009 O'Reilly Media, Inc.