py-wecom-toolkit
企业微信 Python 扩展包,支持 Webhook(群机器人)与 Server 端 API。
py-wecom-toolkit 让你极其简单地与企业微信 API 交互。无需手动拼接 URL,无需手动构建 JSON 负载,自动缓存 access_token,支持同步和异步客户端。
安装
uv pip install py-wecom-toolkit
# 或使用 pip
pip install py-wecom-toolkit
快速开始
from py_wecom_toolkit.webhook.client import WeComWebhookClient
with WeComWebhookClient(key="你的webhook_key") as client:
resp = client.send_text("Hello, World!")
print(f"发送结果: {resp.errmsg}")
import asyncio
from py_wecom_toolkit.webhook.client import AsyncWeComWebhookClient
async def main():
async with AsyncWeComWebhookClient(key="你的webhook_key") as client:
resp = await client.send_text("Hello, World!")
print(f"发送结果: {resp.errmsg}")
asyncio.run(main())
from py_wecom_toolkit.server.client import WeComServerClient
client = WeComServerClient(
corpid="你的CorpID",
corpsecret="你的CorpSecret",
agentid="你的AgentID",
)
token = client.get_access_token()
print(f"access_token: {token}")
resp = client.send_text(content="Hello, WeCom!", touser="Guolei")
print(f"发送结果: {resp.errmsg}")
client.close()
许可证
Metadata
Release files for py-wecom-toolkit 3.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| py_wecom_toolkit-3.0.12.tar.gz | 18.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_wecom_toolkit-3.0.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.5 kB
Release files / py_wecom_toolkit-3.0.12.tar.gz
| Download URL | py_wecom_toolkit-3.0.12.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e960013068da58304c53bed7a8ae566bb8b9e1d965fcfecd4f79e7f664925d7c
|
|
BLAKE2b-256 checksum How to use checksums |
688b0415a266b5cb4b0da9ecbbd16629c966fb86915aae2f94169e9b55104329
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.11
|
Release files / py_wecom_toolkit-3.0.12-py3-none-any.whl
| Download URL | py_wecom_toolkit-3.0.12-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26d1f835303c8817aa7713d482612f3742f9632bedd4151ed16e54e0f8798fe5
|
|
BLAKE2b-256 checksum How to use checksums |
d95af0ee006e05300efcce99c975fa649742b480e950d206c991b4b1f62e3a99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.11
|
Security for py-wecom-toolkit 3.0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.