Skip to main content

IRC (Internet Relay Chat) protocol client library for Python

Project description

The home of irclib is:

http://python-irclib.sourceforge.net

Please see the Project pages (where you can download the library) for information about the project.

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 2.6 or newer (but not Python 3 yet).

Installation:

You have several options to install the IRC project.

  • Use “easy_install irc” or “pip install irc” to grab the latest version from the cheeseshop (recommended).
  • Run “python setup.py install” (from the source distribution) or
  • Run “paver install” (from repo checkout, requires paver) or
  • Copy irc directory to appropriate site-packages 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.
  • 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:

  • irc/client.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!

  • irc/bot.py

    An IRC bot implementation.

Example scripts in the scripts directory:

  • irccat

    A simple example of how to use the IRC client. 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

    An example bot that uses the SingleServerIRCBot class from irc.bot. 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.

NOTE: If you’re running one of the examples on a unix command line, you need to escape the # symbol in the channel. For example, use #test instead of #test.

Enjoy.

Maintainer: Jason R. Coombs <jaraco@jaraco.com>

Original Author: Joel Rosdahl <joel@rosdahl.net>

Project details


Release history Release notifications

History Node

16.3

History Node

16.2.1

History Node

16.2

History Node

16.1

History Node

16.0

History Node

15.1.1

History Node

15.1

History Node

15.0.6

History Node

15.0.5

History Node

15.0.4

History Node

15.0.3

History Node

15.0.2

History Node

15.0.1

History Node

15.0

History Node

14.2.2

History Node

14.2.1

History Node

14.2

History Node

14.1

History Node

14.0

History Node

13.3.1

History Node

13.3

History Node

13.2

History Node

13.1.1

History Node

13.1

History Node

13.0

History Node

12.4.3

History Node

12.4.2

History Node

12.4.1

History Node

12.4

History Node

12.3

History Node

12.2

History Node

12.1.4

History Node

12.1.3

History Node

12.1.2

History Node

12.1.1

History Node

12.1

History Node

12.0

History Node

11.1.1

History Node

11.1

History Node

11.0.1

History Node

11.0

History Node

10.1

History Node

10.0.1

History Node

10.0

History Node

9.0

History Node

8.9.1

History Node

8.9

History Node

8.8

History Node

8.7

History Node

8.6

History Node

8.5.4

History Node

8.5.3

History Node

8.5.2

History Node

8.5.1

History Node

8.5

History Node

8.4

History Node

8.3.2

History Node

8.3.1

History Node

8.3

History Node

8.2

History Node

8.1.2

History Node

8.1.1

History Node

8.1

History Node

8.0.1

History Node

8.0

History Node

7.1.2

History Node

7.1.1

History Node

7.1

History Node

7.0

History Node

6.0.1

History Node

6.0

History Node

5.1.1

History Node

5.1

History Node

5.0.1

History Node

5.0

History Node

4.0

History Node

3.6.1

History Node

3.6

History Node

3.5

History Node

3.4.2

History Node

3.4.1

History Node

3.4

History Node

3.3

History Node

3.2.3

History Node

3.2.2

History Node

3.2.1

History Node

3.2

History Node

3.1.1

History Node

3.1

History Node

3.0.2dev

History Node

3.0.1

This version
History Node

3.0

History Node

2.0.4

History Node

2.0.3

History Node

2.0.2

History Node

2.0.1

History Node

2.0

History Node

1.1

History Node

1.0

History Node

0.9

History Node

0.8

History Node

0.7.1

History Node

0.7

History Node

0.7b6

History Node

0.7b5

History Node

0.7b4

History Node

0.7b3

History Node

0.7b2

History Node

0.7b1

History Node

0.6.1dev

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
irc-3.0.zip (107.9 kB) Copy SHA256 hash SHA256 Source None Sep 5, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page