Chatom¶
A unified Python frontend for Discord, IRC, Matrix, Slack, Symphony, Telegram, and Zulip.
Chatom lets application code use one set of users, channels, messages, formatting nodes, interactions, and backend operations. Platform adapters translate that frontend to Discord, IRC, Matrix, Slack, Symphony, Telegram, or Zulip at the edge. The same models also feed cross-platform bridges, pydantic-ai tools, MCP servers, and CSP graphs.
Install¶
Chatom requires Python 3.11 or newer.
pip install chatom
Install the SDKs for the backends you use:
pip install slack-sdk discord.py matrix-nio symphony-bdk-python python-telegram-bot zulip
Optional integrations are available with chatom[agent] and chatom[mcp].
One message, every backend¶
from chatom import MessageBuilder
message = (
MessageBuilder()
.heading("Deployment status", level=2)
.paragraph("All checks passed.")
.bold("Environment: ")
.text("production")
.table(
[["API", "healthy"], ["Workers", "healthy"]],
headers=["Service", "State"],
)
.build()
)
slack_content = message.render_for("slack")
discord_content = message.render_for("discord")
symphony_content = message.render_for("symphony")
telegram_content = message.render_for("telegram")
matrix_content = message.render_for("matrix")
zulip_content = message.render_for("zulip")
irc_content = message.render_for("irc")
Each backend receives its own dialect: mrkdwn for Slack, Markdown for Discord and Zulip, HTML for Symphony and Matrix, Telegram’s HTML subset, and plain text for IRC.
Message construction stays unchanged. Only rendering and backend configuration know which platform receives it.
Connected backends share the same lifecycle and operation shape:
await backend.connect()
try:
channel = await backend.fetch_channel(name="operations")
await backend.send_message(channel, message.render_for(backend.name))
finally:
await backend.disconnect()
What the frontend covers¶
Platform-independent models for users, channels, organizations, threads, messages, attachments, embeds, reactions, presence, and interactions
Rich text, tables, mentions, embeds, buttons, select menus, and format conversion
A common asynchronous backend interface with a synchronous facade
Backend capabilities for feature-dependent operations such as reactions, editing, files, presence, and threads
Model promotion and demotion between common and backend-specific types
Identity mapping and message forwarding between platforms
Agent, MCP, and CSP integrations built on the same backend contract
In-memory backends for all supported platforms
Documentation¶
License¶
Chatom is licensed under the Apache License 2.0.
Note
This library was generated using copier from the Base Python Project Template repository