Skip to main content

Mezon Python SDK - A Python implementation of the Mezon TypeScript SDK

Project description

Mezon SDK Python

PyPI version Python Support License

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


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.12.tar.gz (142.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mezon_sdk-1.6.12-py3-none-any.whl (159.3 kB view details)

Uploaded Python 3

File details

Details for the file mezon_sdk-1.6.12.tar.gz.

File metadata

  • Download URL: mezon_sdk-1.6.12.tar.gz
  • Upload date:
  • Size: 142.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mezon_sdk-1.6.12.tar.gz
Algorithm Hash digest
SHA256 55c1a540a98f077c7a83382dcde68c4d4e1115440551b5c3b9ea47faf463a3c5
MD5 e01b7ee4ca8f1fe6e09732c7271df525
BLAKE2b-256 cb0f61b77e22b6100d6d3e7cd47a0fd4645c6282a5803c0c42c98c77f6d9221d

See more details on using hashes here.

File details

Details for the file mezon_sdk-1.6.12-py3-none-any.whl.

File metadata

  • Download URL: mezon_sdk-1.6.12-py3-none-any.whl
  • Upload date:
  • Size: 159.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mezon_sdk-1.6.12-py3-none-any.whl
Algorithm Hash digest
SHA256 62cb2024c1d393324a06dd12fb6c133eef9964e93ce2597d7ce7aa3d3e2d14fb
MD5 ef1fd735b09c39d7aee7c6ef711721ff
BLAKE2b-256 632c519612d0ed78d545a2de704463757cbe5a0e7855aee6304cb48b70db7488

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page