You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AAAAAAA 3c7f280c7f Add an asynchronous IRC client implementation преди 1 месец
ircbridge Add an asynchronous IRC client implementation преди 1 месец
sample_app uwu преди 6 месеца uwu преди 6 месеца
pyproject.toml uwu преди 6 месеца


IRCbridge is a python library for easily creating bridges to IRC from arbitrary web hooks


IRCbridge manages dependencies with poetry. Installing dependencies for the main git branch can be done with:

# install poetry <>
pip install poetry
# or, if you like to live dangerously
curl -sSL | python -

poetry install --no-dev

If a git tag is ever made, it’ll have a requirements.txt file generated from poetry, and you can install from that with pip install -r requirements.txt.


A sample application is provided in the sample_app directory, it looks like this:

from ircbridge import IrcBridge

app = IrcBridge("sample_pap")

class Thing:
    foo: str 

def thing_to_irc(thing: thing) -> tuple[bool, str]:
    return True, f"Thing said: {}!"

app.make_route("/", thing_to_irc, Thing)

The basic idea is to create an IrcBridge application, a JSON dataclass (the dataclass decorator is applied automatically by IRCbridge) modeling the webhook payload, a callback function for the class, and a webhook route.

When IRCbridge receives a POST request to the route, it creates an instance of dataclass using the webhook payload, and passes that to the callback function.

The callback function returns a tuple where the first element is a bool, and the second is a string. If the first element is true, IRCbridge will send the second element to an IRC channel. You’ll usually want to return True, "message", but returning False, "" is useful for side-effects without messaging the channel.

How it works, at a more technical level

The IrcBridge class actually subclasses Quart, and runs as a Quart application. Before serving requests, it starts an asynchronous Pydle client; irc messages and webhook requests are all handled in the same thread through Python’s async.


Install dev dependencies with poetry:

poetry install

Then have fun hacking!


Who cares, do whatever.