Source

irc /

Filename Size Date modified Message
6 B
25.9 KB
9.2 KB
956 B
3.4 KB
2.2 KB
2.5 KB
13.1 KB
1.4 KB
1.5 KB
47.6 KB
1.7 KB
4.4 KB
271 B
3.6 KB
irclib -- Internet Relay Chat (IRC) protocol client library
-----------------------------------------------------------

The home of irclib.py is now:

    http://python-irclib.sourceforge.net

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, CTCP and DCC
connections.

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
here:

    http://www.irchelp.org/irchelp/rfc/

Requirements:

  * Python 1.6 or newer.

Installation:

  * Run "python setup.py install" or copy irclib.py and/or ircbot.py
    to an appropriate Python module directory.

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
    event-loop.
  * 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.
  * DCC connection support.

Current limitations:

  * The IRC protocol shines through the abstraction a bit too much.
  * Data is not written asynchronously to the server (and DCC peers),
    i.e. the write() may block if the TCP buffers are stuffed.
  * The author hasn't studied the new RFCs (2810, 2811, 2812 and 2813)
    very closely.
  * Like most projects, documentation is lacking...

Unfortunately, this library isn't as well-documented as I would like
it to be.  I think the best way to get started is to read and
understand the example program irccat, which is included in the
distribution.

The following files might be of interest:

  * irclib.py

    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!

  * irccat

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

  * 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.

  * testbot.py

    An example bot that uses the SingleServerIRCBot class from
    ircbot.py.  The bot enters a channel and listens for commands in
    private messages or channel traffic.  It also accepts DCC
    invitations and echos back sent DCC chat messages.

  * dccreceive

    Receives a file over DCC.

  * dccsend

    Sends a file over DCC.

Enjoy.

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 <joel@rosdahl.net>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.