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://docs.laptrinhai.id.vn/
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.14.tar.gz
(144.8 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.14-py3-none-any.whl
(161.1 kB
view details)
File details
Details for the file mezon_sdk-1.6.14.tar.gz.
File metadata
- Download URL: mezon_sdk-1.6.14.tar.gz
- Upload date:
- Size: 144.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b30a6345b626e1a1cfeda909a73ddb1ddf1c54f81b56f0b210e272da62435b62
|
|
| MD5 |
eaa4889b445a452adfc049f2508f5241
|
|
| BLAKE2b-256 |
c688c4cc2acee4ffcca3832dd61b1e76df6f6e34ec982256f0220859d36ac8e6
|
File details
Details for the file mezon_sdk-1.6.14-py3-none-any.whl.
File metadata
- Download URL: mezon_sdk-1.6.14-py3-none-any.whl
- Upload date:
- Size: 161.1 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 |
bd1f5da9a393e09b04c65f31d7edbbefe3ad36708d317e3fa22373306062820c
|
|
| MD5 |
0cf93302e5f177d41953f71309e94ae9
|
|
| BLAKE2b-256 |
babe7db1a0a912cf642f2521335327ca77cd5ec0fdd12c8adfa56ccf4c45f916
|