irc
IRC (Internet Relay Chat) protocol library for Python
What it is and what it does
The irc package is a full-featured IRC protocol library that abstracts the low-level IRC protocol details into an event-driven framework. It handles multiple simultaneous server connections, automatic server PONG responses, and provides both a traditional select()-based reactor and a Python 3 asyncio-based alternative. The library includes support for CTCP (Client-to-Client Protocol) and DCC (Direct Client Connection) file transfers, plus higher-level abstractions like a simple object-oriented client class and a bot framework.
You use it by instantiating a Reactor, registering event handlers, and calling methods on ServerConnection objects to send messages; incoming server messages trigger events that your handlers catch. The package includes example scripts demonstrating typical patterns. Ten runtime dependencies handle utilities like timezone support via pytz, text processing, and resource imports across Python versions.
Use it for:
- Build an IRC bot that listens to channels and responds to commands or events
- Create a simple IRC client that reads stdin and sends messages to a channel or user
- Implement custom IRC server for testing or internal chat infrastructure
- Handle DCC file transfers programmatically between IRC peers
- Monitor IRC channels and log or react to specific message patterns
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a low-level, event-driven IRC protocol implementation with support for multiple simultaneous connections, CTCP, DCC, and both synchronous and asyncio-based event loops.
Yes, if you need to build IRC clients or bots in Python. The library is stable (Production/Stable status), permissively licensed, has low install friction, and carries no known vulnerabilities. The main gotcha is that documentation is acknowledged as sparse—you'll need to read examples and source code—and the asyncio version lacks DCC support. For straightforward IRC automation or bot work, it's a solid choice.
Install
irc on PyPI
pip
pip install ircuv
uv add ircpoetry
poetry add ircInstalling irc
Before you install
Low friction install with a pure-Python wheel. Maintained actively with recent commits; repository shows ongoing development, suggesting stable rather than abandoned status.
License in practice
MIT-licensed under permissive terms, allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install irc
import irc.client
reactor = irc.client.Reactor()
server = reactor.server()
server.connect('irc.example.com', 'botname')
reactor.process_forever()
Requires Python 3.8 or later. You must understand basic IRC protocol concepts (channels, nicks, commands) to use the library effectively.
Verify before relying
- Whether the asyncio-based client (irc.client_aio) is production-ready given the note that DCC is not implemented in that version
- Current state of documentation quality beyond the included examples and docstrings
- Typical IRC server port numbers and connection parameters for usage examples
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — jaraco.collections, jaraco.text, jaraco.logging, jaraco.functools, jaraco.stream, pytz, more-itertools, tempora, importlib-resources, importlib-metadata |
| Maintenance | actively maintained — 761 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 87,073/month — #13,815 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: irc-20.5.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
TwistedTwisted is an event-driven networking framework…
permissive · top 5,000 on PyPI
txtorcontxtorcon is a client library for controlling…
permissive · top 15,000 on PyPI
websocketswebsockets is a library for building WebSocket…
permissive · top 100 on PyPI
dcc-mcp-coredcc-mcp-core provides a Rust-powered control…
permissive · top 15,000 on PyPI
aiortspProvides asyncio-based RTSP client…
copyleft · top 15,000 on PyPI
twitchAPIA Python client library for the Twitch Helix…
permissive · top 15,000 on PyPI
anyioAnyIO provides a unified asynchronous API that…
permissive · top 100 on PyPI
aiochannelProvides asyncio-compatible channels (closable…
permissive · top 15,000 on PyPI
aeventkitaeventkit provides event-driven data pipelines…
permissive · top 15,000 on PyPI
jaraco.classesProvides utility functions for working with…
permissive · top 1,000 on PyPI