Registry / communication / irc
library20.5.0pypypiunverified

IRC (Internet Relay Chat) protocol library for Python. Provides client and server implementations. Current version: 20.5.0. Release cadence: irregular, a few times per year.

pip install irc
INSTALL
IMPORT
SIG · IRC
I
irc
communicationpythonv20.5.0
Install
3.7s avg
Import
Disk
36MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v20.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 37.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.7s · import 0.000s · 38MB
36MB installed
● package 36MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IRCClient
from irc.client import IRCClient
from irc.client import IRCClient
contextlib
from irc import contextlib
metadata
from irc import metadata

Basic IRC bot connecting to Libera.Chat and printing messages.

import irc.client import os server = 'irc.libera.chat' port = 6667 nick = 'MyBot' class MyClient(irc.client.SimpleIRCClient): def on_welcome(self, connection, event): connection.join('#testchannel') def on_pubmsg(self, connection, event): print(f"{event.source.nick}: {event.arguments[0]}") client = MyClient() client.connect(server, port, nick) client.start()
Debug
Known issues
breakingIn v20.0.0, the `irc.client` module was restructured. `irc.client.IRC` is now `irc.client.IRCClient`. Old imports break.
fix
Use `from irc.client import IRCClient` instead of `from irc.client import IRC`.
affects: <20.0.0
breakingIn v20.0.0, `on_join`, `on_part`, etc. callbacks now receive `connection` and `event` arguments (previously different).
fix
Update callback signatures to `def on_join(self, connection, event):`.
affects: <20.0.0
gotchaThe library uses Python's `select` module by default, which does not support Windows' socket behaviour. On Windows, it may hang or fail.
fix
Use an asynchronous event loop (e.g., `irc.client.aio`) or set `irc.client.ServerConnection.buffer_class = irc.buffer.LenientDecodingLineBuffer`.
affects: all
Upgrade
Version history
20.5.0latest on PyPI · released Jul 14, 2024
Audit
Dependencies
jaraco.functoolsrequiredUsed internally for functional utilities.
jaraco.collectionsrequiredUsed internally for collection utilities.
jaraco.textrequiredUsed internally for text processing.
jaraco.streamrequiredUsed internally for stream processing.
more-itertoolsrequiredUsed internally for iteration utilities.
pytzrequiredTimezone handling for timestamp parsing.
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
irc — pip install irc · libregistry