Skip to main content

py-wecom-toolkit

PyPI version Python Version

文档 | API 参考

企业微信 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()

许可证

MIT

Metadata

Release files for py-wecom-toolkit 3.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-wecom-toolkit 3.0.11
File Size Uploaded Provenance
py_wecom_toolkit-3.0.11.tar.gz 19.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for py-wecom-toolkit 3.0.11
File Interpreter ABI Platform
py_wecom_toolkit-3.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 42.5 kB

Release files / py_wecom_toolkit-3.0.11.tar.gz

Download URL py_wecom_toolkit-3.0.11.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5a0102ff76e999aea8c5a64d130fc6769bc0fd2485c960f227cf19394762ad79
BLAKE2b-256 checksum
How to use checksums
b25e9241ec0f6f401b8570a079f21ca66ca1fd8baa22827c5e208f38dfce18ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Release files / py_wecom_toolkit-3.0.11-py3-none-any.whl

Download URL py_wecom_toolkit-3.0.11-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d277dfb3f6a4b77b6c81335706fac05bd96ea704df99cb0121d6269c1a737fd
BLAKE2b-256 checksum
How to use checksums
1581a1db531208506d21c1a0ad9283e4f701941949476426931c82eef22a72e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Security for py-wecom-toolkit 3.0.11

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page