Skip to main content

irc-toolkit

An IRC client toolkit in Python.

Installation

$ pip install irc-toolkit

Usage

There are a few parts of irc-toolkit, depending on your goals. irctk.Message offers IRC message parsing, irctk.Client offers an IRC client which handles connection/channel/nick tracking giving you a callback based interface for IRC messages, for example:

#!/usr/bin/env python

import asyncio
import logging

import irctk


class Bot:
    async def connect(self, hostname, port=6697, secure=True):
        client = irctk.Client()
        client.delegate = self
        await client.connect(hostname, port, secure)

    def irc_registered(self, client):
        client.send('MODE', client.nick, '+B')
        client.send('JOIN', '#test')

    def irc_private_message(self, client, nick, message):
        if message == 'ping':
            client.send('PRIVMSG', nick, 'pong')

    def irc_channel_message(self, client, nick, channel, message):
        if message == 'ping':
            client.send('PRIVMSG', channel, f'{nick}: pong')
        elif message == 'quit':
            client.quit()


if __name__ == '__main__':
    # Enable debug logging
    logging.basicConfig(level='DEBUG')

    bot = Bot()
    asyncio.run(bot.connect('irc.darkscience.net'))

Metadata

Release files for irc-toolkit 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for irc-toolkit 0.4.0
File Size Uploaded Provenance Actions
irc_toolkit-0.4.0.tar.gz 13.2 kB Without provenance Details for irc_toolkit-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for irc-toolkit 0.4.0
File Interpreter ABI Platform Actions
irc_toolkit-0.4.0-py3-none-any.whl Python 3 none any Details for irc_toolkit-0.4.0-py3-none-any.whl

Total release size: 27.9 kB

Release files / irc_toolkit-0.4.0.tar.gz

Download URL irc_toolkit-0.4.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
32c9045815d38938daa80fec3137b3a5ee95632478aed4f4c323e77357fe99d9
BLAKE2b-256 checksum
How to use checksums
eb18e9d4e0846f2b35d2620c54f83b4dab6029e1def8267695e9ce229ab15e28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Linux/6.6.58

Release files / irc_toolkit-0.4.0-py3-none-any.whl

Download URL irc_toolkit-0.4.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d075d3b66dd27f931997f04bc32b0165b835f42e7773a8fe94fb0ebbeb2c79a
BLAKE2b-256 checksum
How to use checksums
f59b5cbe62bc102517d9380bc2148e786ccac90ef9729f56ff1e904d21e576a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Linux/6.6.58

Security for irc-toolkit 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page