IO backends

This module contains the I/O backends for PyIRC. The backends inherit from IRCBase to pump messages in and out of the library, and perform scheduling functions.

asyncio

Support for asyncio, available in Python 3.4 and later (and 3.3 via a backport).

class PyIRC.io.asyncio.IRCProtocol(*args, **kwargs)

The asyncio implementation of the IRC protocol. Available only with Python 3.4 and above in the standard library, and 3.3 via an external module.

The same methods as IRCBase are available.

socket

A basic socket/ssl/sched-based module implementation for IRC.

If you just want a simple bot for one network, this is what you want.

Note all socket stuff is blocking, if you want non-blocking operation, you may want to subclass this and modify things for your application.

This also serves as a useful example.

class PyIRC.io.socket.IRCSocket(serverport, username, nick, gecos, extensions, **kwargs)

The socket implementation of the IRC protocol. No asynchronous I/O is done. All scheduling is done with socket timeouts and the python sched module.

The same methods available in IRCBase are available.

Key socket_timeout:
 Set the timeout for connecting to the server (defaults to 10)
Key send_timeout:
 Set the timeout for sending data (default None)
Key recv_timeout:
 Set the timeout for receiving data (default None)
Key family:The family to use for the socket (default AF_INET, IPv4). Set to socket.AF_INET6 for IPv6 usage.
loop()

Simple loop for bots.

Does not return, but raises exception when the connection is closed.