Async Python client for the Max messenger Bot API
Project description
python-max-bot
Async Python client for the Max messenger Bot API.
A thin, stable, Pydantic-modeled wrapper. No bot framework, no FSM, no middleware — just the API surface you need to send messages, upload attachments, and poll for updates.
Install
pip install python-max-bot
Quickstart
import asyncio
from max_bot_api import MaxClient
async def main():
async with MaxClient(token="YOUR_BOT_TOKEN") as client:
# Send a plain message
await client.send_message(chat_id=42, text="Hello, Max!")
# Send a message with an image
with open("photo.jpg", "rb") as f:
img = await client.upload_image(f.read(), filename="photo.jpg")
await client.send_message(
chat_id=42,
text="<b>Look at this</b>",
format="html",
attachments=[img],
)
asyncio.run(main())
What's in v0.1
| Feature | Status |
|---|---|
| Send / edit / delete messages | ✅ |
Long-poll updates (get_updates) |
✅ |
| Image / video / audio / file uploads | ✅ |
| Inline keyboards | ✅ |
Chat metadata (get_chat) |
✅ |
| HTML and Markdown formatting | ✅ |
| Typed exceptions per HTTP status | ✅ |
| Auto-retry / backoff | ⏳ v0.2 |
| Webhook subscription endpoints | ⏳ v0.3+ |
| Bot framework (handlers, FSM) | ❌ out of scope |
Errors
from max_bot_api import (
MaxClient,
MaxAuthError,
MaxRateLimitError,
MaxTransportError,
)
async with MaxClient(token=...) as client:
try:
await client.send_message(chat_id=42, text="hi")
except MaxAuthError:
# Bad token — surface to user
...
except MaxRateLimitError as e:
await asyncio.sleep(e.retry_after or 1)
except MaxTransportError:
# Network problem; retry your way
...
Built with Claude
This project is developed in collaboration with Claude, Anthropic's AI assistant — design, code, and tests. Commits are co-authored. The repo ships with a CLAUDE.md and .claude/settings.json so any contributor running Claude on the codebase picks up the same conventions automatically. See the v0.1 design for the full collaboration workflow.
Links
- Max Bot API docs — upstream reference
- Design doc — what's in scope and what isn't
- CHANGELOG
- Contributing
License
MIT — see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_max_bot-0.1.0.tar.gz.
File metadata
- Download URL: python_max_bot-0.1.0.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7fb2a840997a95e32632c1dcca27f0ffbcca824a498c65e61f32a8e38b09e42
|
|
| MD5 |
7d5764e3922bd21bf1706647db695309
|
|
| BLAKE2b-256 |
9d3b2cdd75be40c616e2124d83a3ae76a5d87dfde930b3bcb01c99c47bb1e0f5
|
Provenance
The following attestation bundles were made for python_max_bot-0.1.0.tar.gz:
Publisher:
release.yml on Kitaeza/python-max-bot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_max_bot-0.1.0.tar.gz -
Subject digest:
b7fb2a840997a95e32632c1dcca27f0ffbcca824a498c65e61f32a8e38b09e42 - Sigstore transparency entry: 1437328992
- Sigstore integration time:
-
Permalink:
Kitaeza/python-max-bot@f2d419787964aee67101e8a5a4bee3ea332a0ddc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Kitaeza
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f2d419787964aee67101e8a5a4bee3ea332a0ddc -
Trigger Event:
push
-
Statement type:
File details
Details for the file python_max_bot-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_max_bot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81385e1354a3ffb870efe11263260b026c8cedc25d7fc4389c7295660d7899db
|
|
| MD5 |
b435d2f81a7d16464c6e6d557a4a9774
|
|
| BLAKE2b-256 |
e1cc092a379dd04d0c61c8a4cf074da23e1a0fe796961477e8eff3c27c15da00
|
Provenance
The following attestation bundles were made for python_max_bot-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Kitaeza/python-max-bot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_max_bot-0.1.0-py3-none-any.whl -
Subject digest:
81385e1354a3ffb870efe11263260b026c8cedc25d7fc4389c7295660d7899db - Sigstore transparency entry: 1437329017
- Sigstore integration time:
-
Permalink:
Kitaeza/python-max-bot@f2d419787964aee67101e8a5a4bee3ea332a0ddc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Kitaeza
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f2d419787964aee67101e8a5a4bee3ea332a0ddc -
Trigger Event:
push
-
Statement type: