Metadata-Version: 2.5
Name: chatom
Version: 0.2.2
Summary: Minimum viable chat components
Project-URL: Repository, https://github.com/1kbgz/chatom
Project-URL: Homepage, https://github.com/1kbgz/chatom
Author-email: the chatom authors <dev@1kbgz.com>
License: Apache-2.0
License-File: LICENSE
Keywords: agent,chat,chatbot,discord,llm,mcp,messenger,model-context-protocol,slack,symphony,telegram
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.11
Requires-Dist: mistune>=3
Requires-Dist: pydantic>=2
Requires-Dist: singledispatch
Provides-Extra: agent
Requires-Dist: openpyxl<4,>=3.1; extra == 'agent'
Requires-Dist: pydantic-ai>=0.4; extra == 'agent'
Requires-Dist: pypdf<7,>=6; extra == 'agent'
Requires-Dist: python-docx<2,>=1; extra == 'agent'
Requires-Dist: reportlab<6,>=4; extra == 'agent'
Provides-Extra: develop
Requires-Dist: build; extra == 'develop'
Requires-Dist: bump-my-version; extra == 'develop'
Requires-Dist: check-dist; extra == 'develop'
Requires-Dist: codespell; extra == 'develop'
Requires-Dist: csp; extra == 'develop'
Requires-Dist: discord-py; extra == 'develop'
Requires-Dist: fastmcp>=2; extra == 'develop'
Requires-Dist: hatchling; extra == 'develop'
Requires-Dist: hydra-core>=1.3; extra == 'develop'
Requires-Dist: mdformat; extra == 'develop'
Requires-Dist: mdformat-tables>=1; extra == 'develop'
Requires-Dist: openpyxl<4,>=3.1; extra == 'develop'
Requires-Dist: pydantic-ai>=0.4; extra == 'develop'
Requires-Dist: pypdf<7,>=6; extra == 'develop'
Requires-Dist: pytest; extra == 'develop'
Requires-Dist: pytest-asyncio; extra == 'develop'
Requires-Dist: pytest-cov; extra == 'develop'
Requires-Dist: pytest-mock; extra == 'develop'
Requires-Dist: python-docx<2,>=1; extra == 'develop'
Requires-Dist: python-telegram-bot; extra == 'develop'
Requires-Dist: reportlab<6,>=4; extra == 'develop'
Requires-Dist: ruff; extra == 'develop'
Requires-Dist: slack-sdk; extra == 'develop'
Requires-Dist: symphony-bdk-python; extra == 'develop'
Requires-Dist: twine; extra == 'develop'
Requires-Dist: ty; extra == 'develop'
Requires-Dist: uv; extra == 'develop'
Requires-Dist: whatsapp-python; extra == 'develop'
Requires-Dist: wheel; extra == 'develop'
Provides-Extra: mcp
Requires-Dist: fastmcp>=2; extra == 'mcp'
Requires-Dist: hydra-core>=1.3; extra == 'mcp'
Description-Content-Type: text/markdown

<p>
  <img src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-light.png?raw=true#gh-light-mode-only" alt="chatom" width="150">
  <img src="https://github.com/1kbgz/chatom/raw/main/docs/img/logo-dark.png?raw=true#gh-dark-mode-only" alt="chatom" width="150">
</p>

# Chatom

A unified Python frontend for Discord, Slack, Symphony, Telegram, and other chat backends.

[![Build Status](https://github.com/1kbgz/chatom/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/1kbgz/chatom/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/1kbgz/chatom/branch/main/graph/badge.svg?token=IubQKhtRoK)](https://codecov.io/gh/1kbgz/chatom)
[![License](https://img.shields.io/github/license/1kbgz/chatom)](https://github.com/1kbgz/chatom)
[![PyPI](https://img.shields.io/pypi/v/chatom.svg)](https://pypi.python.org/pypi/chatom)

Chatom lets application code use one set of users, channels, messages, formatting nodes, interactions, and backend operations. Platform adapters translate that frontend to Discord, Slack, Symphony, or Telegram 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.

```bash
pip install chatom
```

Install the SDKs for the backends you use:

```bash
pip install slack-sdk discord.py symphony-bdk-python python-telegram-bot
```

Optional integrations are available with `chatom[agent]` and `chatom[mcp]`.

## One message, four backends

```python
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")
```

Message construction stays unchanged. Only rendering and backend configuration know which platform receives it.

Connected backends share the same lifecycle and operation shape:

```python
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 Discord, Slack, Symphony, and Telegram backends for tests

## Documentation

- [Installation](docs/src/installation.md)
- [Tutorials](docs/src/tutorials.md)
- [How-to guides](docs/src/howtos.md)
- [Why the unified frontend works](docs/src/concepts.md)
- [API reference](docs/src/api.md)

## License

Chatom is licensed under the [Apache License 2.0](LICENSE).

> [!NOTE]
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base)
