irc /

Filename Size Date modified Message
10 B
17.6 KB
2.9 KB
561 B
3.4 KB
12.3 KB
1.4 KB
1.4 KB
38.4 KB
3.7 KB
2.7 KB
irclib -- Internet Relay Chat (IRC) protocol client library

This library is intended to encapsulate the IRC protocol at a quite
low level.  It provides an event-driven IRC client framework.  It has
a fairly thorough support for the basic IRC protocol and CTCP, but DCC
connection support is not yet implemented.  It actually does CTCP
parsing exactly as the CTCP specifications describe it -- I've never
seen another IRC client do that!

In order to understand how to make an IRC client, I'm afraid you more
or less must understand the IRC specifications.  They are available

The main features of the IRC client framework are:

  * Abstraction of the IRC protocol.
  * Handles multiple simultaneous IRC server connections.
  * Handles server PONGing transparently.
  * Messages to the IRC server are done by calling methods on an IRC
    connection object.
  * Messages from an IRC server triggers events, which can be caught
    by event handlers.
  * Reading from and writing to IRC server sockets are normally done
    by an internal select() loop, but the select()ing may be done by
    an external main loop.
  * Functions can be registered to execute at specified times by the
  * Decodes CTCP tagging correctly (hopefully); I haven't seen any
    other IRC client implementation that handles the CTCP
    specification subtilties.
  * A kind of simple, single-server, object-oriented IRC client class
    that dispatches events to instance methods is included.

Current limitations:

  * The IRC protocol shines through the abstraction a bit too much.
  * Data is not written asynchronously to the server, i.e. the write()
    may block if the TCP buffers are stuffed.
  * There are no support for DCC connections.
  * The author haven't even read RFC 2810, 2811, 2812 and 2813.
  * Like most projects, documentation is lacking...

Unfortunately, this library isn't as well-documented as I would like
it to be.  There is some documentation in HTML format in the doc
subdirectory.  It is generated from the docstrings in by the
pythondoc utility.  I think the best way to get started is to read and
understand the example program irccat, which is included in the

The following files might be of interest:


    The library itself.  Read the code along with comments and
    docstrings to get a grip of what it does.  Use it at your own risk
    and read the source, Luke!  There is also an HTML version of the
    docstring documentation in the doc subdirectory.

  * irccat

    A simple example of how to use  irccat reads text from
    stdin and writes it to a specified user or channel on an IRC

  * irccat2

    The same as above, but using the SimpleIRCClient class.

  * servermap

    Another simple example.  servermap connects to an IRC server,
    finds out what other IRC servers there are in the net and prints
    a tree-like map of their interconnections.


    An example bot that uses the SingleServerIRCBot class from  The bot enters a channel and listens for commands in
    private messages or channel traffic.


Since I seldom use IRC anymore, I will probably not work much on the
library.  If you want to help or continue developing the library,
please contact me.

Joel Rosdahl <>