Metadata-Version: 2.4
Name: allchats-sdk
Version: 0.1.2
Summary: Messenger integrations SDK (Telegram, VK, MAX, Avito, Discord, WhatsApp)
Author-email: "messager.shop" <sojiguy@mail.ru>
License: MIT License
        
        Copyright (c) 2026 messager.shop
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/https-allchats-pro/sdk
Project-URL: Repository, https://github.com/https-allchats-pro/sdk
Project-URL: Issues, https://github.com/https-allchats-pro/sdk/issues
Project-URL: Documentation, https://github.com/https-allchats-pro/sdk/tree/main/docs
Keywords: messenger,telegram,vk,max,whatsapp,discord,avito,sdk,telethon
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Provides-Extra: telegram
Requires-Dist: telethon>=1.36.0; extra == "telegram"
Requires-Dist: ntgcalls>=3.0.0b4; extra == "telegram"
Requires-Dist: python-socks[asyncio]>=2.4.0; extra == "telegram"
Requires-Dist: PySocks>=1.7.1; extra == "telegram"
Provides-Extra: vk
Requires-Dist: vk-api>=11.9.9; extra == "vk"
Requires-Dist: requests>=2.31.0; extra == "vk"
Provides-Extra: max
Requires-Dist: maxapi-python>=2.0.0; extra == "max"
Provides-Extra: whatsapp
Requires-Dist: neonize>=0.4.1.post0; extra == "whatsapp"
Requires-Dist: protobuf<8,>=7.34.1; extra == "whatsapp"
Provides-Extra: discord
Requires-Dist: discord.py-self>=2.1.0; extra == "discord"
Requires-Dist: aiohttp>=3.9.0; extra == "discord"
Requires-Dist: websockets>=13.0; extra == "discord"
Requires-Dist: cryptography>=43.0.0; extra == "discord"
Requires-Dist: PyNaCl>=1.5.0; extra == "discord"
Requires-Dist: opuslib>=3.0.1; extra == "discord"
Requires-Dist: davey>=0.1.6; extra == "discord"
Requires-Dist: curl_cffi>=0.7.0; extra == "discord"
Requires-Dist: qrcode>=7.4.2; extra == "discord"
Provides-Extra: avito
Requires-Dist: requests>=2.31.0; extra == "avito"
Provides-Extra: all
Requires-Dist: allchats-sdk[avito,discord,max,telegram,vk,whatsapp]; extra == "all"
Dynamic: license-file

# AllChats SDK

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.

[![PyPI](https://img.shields.io/pypi/v/allchats-sdk.svg)](https://pypi.org/project/allchats-sdk/)
[![Python](https://img.shields.io/pypi/pyversions/allchats-sdk.svg)](https://pypi.org/project/allchats-sdk/)
[![CI](https://github.com/https-allchats-pro/sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/https-allchats-pro/sdk/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

## Installation

```bash
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.

## Quick start

```python
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/`](examples/README.md).

## Supported messengers

| Provider | Extra | Public client | Status |
|----------|-------|---------------|--------|
| Telegram | `[telegram]` | `TelegramClient` | First-class |
| VK | `[vk]` | `VKClient` | First-class |
| MAX | `[max]` | `MAXClient` | Host `session_host` required |
| WhatsApp | `[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`](docs/capabilities.md).

## Capabilities

Account clients expose capability groups via properties:

```python
client.auth       # connect, QR, disconnect, …
client.messages   # send
client.chats      # client_state / sync (when supported)

from allchats_sdk import Capability
list(Capability)  # messages, chats, auth
```

Unsupported groups raise `UnsupportedCapabilityError`. There is no `client.capabilities` list API — probe the properties you need.

## Documentation

| Guide | Description |
|-------|-------------|
| [Getting started](docs/getting-started.md) | Install → connect → send / receive |
| [Architecture](docs/architecture.md) | Public vs internal layers |
| [Authentication](docs/authentication.md) | QR, token, OAuth, MAX host |
| [Events](docs/events.md) | `EventSink` and event types |
| [Capabilities](docs/capabilities.md) | Matrix + how to probe |
| [Credentials](docs/credentials.md) | Stores and sanitization |
| [Errors](docs/errors.md) | Exception hierarchy |
| [Security](docs/security.md) | Sessions, logging, reporting |
| [Providers](docs/providers/) | Per-messenger notes |

## Security

Do not commit session files or tokens. See [`SECURITY.md`](SECURITY.md) and [`docs/security.md`](docs/security.md).

## Contributing

```bash
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.internal` in application code.
- Open a PR against `main`; CI must pass.

## License

MIT — see [LICENSE](LICENSE).
