Mezon Python SDK - A Python implementation of the Mezon TypeScript SDK
Project description
Mezon SDK Python
A Python SDK for building bots and applications on the Mezon platform. Async-first, type-safe, and production-ready.
Installation
pip install mezon-sdk
Quick Start
import asyncio
from mezon import MezonClient
from mezon.models import ChannelMessageContent
from mezon.protobuf.api import api_pb2
client = MezonClient(
client_id="YOUR_BOT_ID",
api_key="YOUR_API_KEY",
)
async def handle_message(message: api_pb2.ChannelMessage):
if message.sender_id == client.client_id:
return
channel = await client.channels.fetch(message.channel_id)
await channel.send(content=ChannelMessageContent(t="Hello!"))
client.on_channel_message(handle_message)
async def main():
await client.login()
await asyncio.Event().wait()
asyncio.run(main())
Documentation
Full documentation: https://phuvinh010701.github.io/mezon-sdk-python/
Features
- Async/await native with
asyncio - Real-time WebSocket with auto-reconnection
- Type-safe with Pydantic models
- Event-driven architecture
- Interactive messages (buttons, forms)
- Token sending support
- Message caching with SQLite
Links
License
Apache License 2.0 - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mezon_sdk-1.6.11.tar.gz
(146.0 kB
view details)
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
mezon_sdk-1.6.11-py3-none-any.whl
(162.2 kB
view details)
File details
Details for the file mezon_sdk-1.6.11.tar.gz.
File metadata
- Download URL: mezon_sdk-1.6.11.tar.gz
- Upload date:
- Size: 146.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f6a3b1feb6e3ae4a53e28e1a6e1a1bcd84072b1ae92f01b38d33417c20b9f71
|
|
| MD5 |
00201f9da9f9889f28e659127de74237
|
|
| BLAKE2b-256 |
c9dbe67d288de60dc5c9d0b5eb6f85b6dd102b25524b3efabb8ea3981e2519fd
|
File details
Details for the file mezon_sdk-1.6.11-py3-none-any.whl.
File metadata
- Download URL: mezon_sdk-1.6.11-py3-none-any.whl
- Upload date:
- Size: 162.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c433ff6e8b1edcb2d32986ea5107534fbc248f6c3e301459e527e6bc8bd81985
|
|
| MD5 |
30255255a7cc5df10ae4786a32aa286b
|
|
| BLAKE2b-256 |
d7db641e83dd5a70aa889e159f87afac48720e7a289fbdb5501f200b1916b060
|