Unified Python SDK for messaging platforms.
Connect Telegram, VK, MAX, and other messengers through one account-oriented API: authenticate, send, receive events, and persist sessions — without FastAPI or a database.
pip install allchats-sdk
# provider-specific integrations
pip install "allchats-sdk[telegram]"
pip install "allchats-sdk[vk]"
pip install "allchats-sdk[max]"
pip install "allchats-sdk[telegram,vk]"Requires Python 3.11+. The base install is minimal; messenger runtimes are optional extras.
import asyncio
from allchats_sdk.telegram import TelegramClient
from allchats_sdk import FileCredentialStore
async def main() -> None:
store = FileCredentialStore("./telegram-session.json")
client = TelegramClient(
account_id="acc-1",
app_id=12345, # https://my.telegram.org/apps
app_hash="your_app_hash",
credential_store=store,
)
await client.auth.start_qr()
await client.auth.wait_until_authorized(
password_provider=lambda: input("2FA password: "),
)
await client.connect()
message_id, chat_id = await client.messages.send("hello", chat_id="123456789")
print(message_id, chat_id)
await client.disconnect()
asyncio.run(main())More scripts: examples/.
| Provider | Extra | Public client | Status |
|---|---|---|---|
| Telegram | [telegram] |
TelegramClient |
First-class |
| VK | [vk] |
VKClient |
First-class |
| MAX | [max] |
MAXClient |
Host session_host required |
[whatsapp] |
— | Manager / host (no public client yet) | |
| Discord | [discord] |
— | Manager / host (no public client yet) |
| Avito | [avito] |
— | Manager / host (no public client yet) |
Capability details: docs/capabilities.md.
Account clients expose capability groups via properties:
client.auth # connect, QR, disconnect, …
client.messages # send
client.chats # client_state / sync (when supported)
from allchats_sdk import Capability
list(Capability) # messages, chats, authUnsupported groups raise UnsupportedCapabilityError. There is no client.capabilities list API — probe the properties you need.
| Guide | Description |
|---|---|
| Getting started | Install → connect → send / receive |
| Architecture | Public vs internal layers |
| Authentication | QR, token, OAuth, MAX host |
| Events | EventSink and event types |
| Capabilities | Matrix + how to probe |
| Credentials | Stores and sanitization |
| Errors | Exception hierarchy |
| Security | Sessions, logging, reporting |
| Providers | Per-messenger notes |
Do not commit session files or tokens. See SECURITY.md and docs/security.md.
git clone https://github.com/https-allchats-pro/sdk.git
cd sdk
pip install -e ".[all,dev]"
pytest- Prefer public imports (
allchats_sdk,allchats_sdk.telegram, …). - Do not rely on
allchats_sdk.internalin application code. - Open a PR against
main; CI must pass.
MIT — see LICENSE.