wecom-aibot-python-sdk
企业微信智能机器人 Python SDK —— 基于 WebSocket 长连接通道,提供消息收发、流式回复、模板卡片、事件回调、文件下载解密等核心能力。
Decision gist · record as of 2026-08-14
Yes. The SDK is actively maintained, has no known vulnerabilities, uses permissive MIT licensing, and offers low install friction. Install it if you need to build a WeChat Work bot in Python. The async-native design and built-in features (streaming, cards, file decryption, reconnection) make it the natural choice for this use case.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.8 and a valid WeChat Work bot_id and secret from the enterprise WeChat admin console.
- Low friction install with a pure-Python wheel and five well-established async dependencies (websockets, aiohttp, pyee, cryptography, certifi).
- Actively maintained with recent commits and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
last release 2026-03-23 (144 days) · last repo commit 2026-03-23 · 40 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 159,024 downloads/mo, #10,709 on PyPI
Alternatives
Verify before relying
pip install wecom-aibot-python-sdk
from aibot import WSClient, WSClientOptions
ws_client = WSClient(WSClientOptions(
bot_id='your-bot-id',
secret='your-bot-secret'
))
@ws_client.on('message.text')
async def on_text(frame):
await ws_client.reply_stream(frame, 'stream-id', 'Hello!', True)
ws_client.run()- Whether the SDK handles reconnection and heartbeat automatically without user code intervention.
- Performance characteristics under high message volume or concurrent streams.
- Completeness of error handling and recovery for network failures beyond the documented exponential backoff.
What it is and what it does
wecom-aibot-python-sdk is a Python client for WeChat Work's AI bot API, built on asyncio and WebSocket. It manages long-lived connections to WeChat Work's servers, automatically handles authentication, heartbeat, and reconnection with exponential backoff. The SDK parses incoming messages (text, image, voice, file, mixed) and events (enter chat, template card clicks, user feedback), then routes them to your async event handlers.
You use it to build chatbots and automation agents: listen for incoming messages, send streaming text replies with Markdown support, post template cards, update cards in-place, proactively push messages to users, and download encrypted files. All operations are async/await native, with built-in AES-256-CBC file decryption, pluggable logging, and a serial reply queue that ensures messages for the same request ID are sent in order.
Use it for
- Build a WeChat Work chatbot that streams AI-generated responses with Markdown formatting.
- Send proactive notifications or alerts to users via template cards without waiting for an incoming message.
- Handle file uploads from users, decrypt them server-side, and process or store the contents.
- Respond to user interactions (button clicks on template cards) with follow-up messages or state updates.
- Implement a multi-turn conversation bot that tracks session state and sends welcome messages when users enter a chat.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The SDK is actively maintained, has no known vulnerabilities, uses permissive MIT licensing, and offers low install friction. Install it if you need to build a WeChat Work bot in Python. The async-native design and built-in features (streaming, cards, file decryption, reconnection) make it the natural choice for this use case.
Install
wecom-aibot-python-sdk on PyPI
Before you install
Low friction install with a pure-Python wheel and five well-established async dependencies (websockets, aiohttp, pyee, cryptography, certifi). Actively maintained with recent commits and no known vulnerabilities.
Requires Python >= 3.8 and a valid WeChat Work bot_id and secret from the enterprise WeChat admin console.
License in practice
MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install wecom-aibot-python-sdk
from aibot import WSClient, WSClientOptions
ws_client = WSClient(WSClientOptions(
bot_id='your-bot-id',
secret='your-bot-secret'
))
@ws_client.on('message.text')
async def on_text(frame):
await ws_client.reply_stream(frame, 'stream-id', 'Hello!', True)
ws_client.run()
Verify before relying
- Whether the SDK handles reconnection and heartbeat automatically without user code intervention.
- Performance characteristics under high message volume or concurrent streams.
- Completeness of error handling and recovery for network failures beyond the documented exponential backoff.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packageswebsocketsaiohttppyeecryptographycertifi |
| Maintenance | Actively maintained 144 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 159,024 / month, #10,709 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Communications :: ChatTopic :: Software Development :: Libraries :: Python Modules |
Evidence: wecom_aibot_python_sdk-1.0.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “wecom enterprise wechat bot sdk”
- wecom-aibot-python-sdkA Python SDK for WeChat Work (企业微信) AI bot that manages WebSocket…
- wechatpyWeChat SDK providing Python bindings for WeChat's public platform,…
- wechatpayv3SDK for integrating WeChat Pay API v3 into Python applications,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also wechatpy · pywxdump · botframework-connector · line-bot-sdk · pipecat-ai-whisker · dingtalk-stream · aiogram · pyTelegramBotAPI · coinbase-advanced-py · plexwebsocket