Python is very suitable for working with the Internet Relay Chat (IRC) protocol. But working directly with a protocol can be a bit messy. Fortunately, there is a library that can simplify this work: Python-IRCLib. This article, the first of three parts, takes a look at this library and what you can do with it, with a focus on event handling.
I have written several articles for DevShed relating to Internet Relay Chat – IRC. It's an area of personal interest, and I think Python is very suitable for working with the protocol. However, the articles have focused on working directly with the protocol, rather than employing a library to handle the protocol work. If you have read the articles, you probably know that protocol work can be a bit messy.
Thankfully, a library exists that can work in the middle of your program and the IRC protocol, Python-IRCLib. The library greatly simplifies the creation of applications that interact through IRC by abstracting the protocol. It even contains code that deals specifically with the creation of bots that can communicate with and take orders from the members of the specified IRC server. What's more is that the bots are incredibly simple to create.
The library currently has no documentation. It only contains brief examples of applications that use it. That's a shame, though, since it is a great library. However, in this article, we will examine the library through both explanation and example.