lush-wecom
WeCom(企业微信) 的客户端封装与数据模型. 目标是让你少写一点“拼 URL + 拼 params + 手动处理 errcode”的重复代码.
它提供:
- 同步/异步两套客户端
- access_token 管理(可接 Redis 或自定义存储)
- 统一的异常与重试策略
- pydantic v2 的请求/响应模型
快速开始
from lush_wecom import WeComClient, WeComTokenManager
from lush_wecom.models.send_app_message_vo import SendAppMessageRequest, TextContent
token_mgr = WeComTokenManager(corpid="YOUR_CORP_ID", corpsecret="YOUR_CORP_SECRET")
client = WeComClient(token_manager=token_mgr)
req = SendAppMessageRequest(
touser="userid1|userid2",
agentid=1000002,
msgtype="text",
text=TextContent(content="hello"),
)
resp = client.send_app_message(req)
开发
uv sync -p 3.10 --frozen
uv run -p 3.10 pytest
目录结构
src/lush_wecom/
├── __init__.py # 包导出
├── client/ # 客户端实现
│ ├── __init__.py # 客户端统一导出
│ ├── _async/ # 异步客户端实现
│ └── _sync/ # 同步客户端实现
├── core/ # 核心功能
│ ├── base.py # 基础客户端类
│ ├── const.py # 常量定义
│ ├── exceptions.py # 异常定义
│ ├── storage.py # 存储抽象
│ └── token_mgr.py # Token管理器
├── models/ # 数据模型
│ ├── common_vo.py # 通用模型
│ ├── *_vo.py # 各API专用模型
├── utils/ # 工具函数
│ ├── retry.py # 重试工具
│ └── oauth.py # OAuth工具
└── tests/ # 测试代码
Metadata
Release files for lush-wecom 0.1.1
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 | Actions |
|---|---|---|---|---|
| lush_wecom-0.1.1.tar.gz | 46.4 kB | Without provenance | Details for lush_wecom-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lush_wecom-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for lush_wecom-0.1.1-py3-none-any.whl |
Total release size: 112.3 kB
Release files / lush_wecom-0.1.1.tar.gz
| Download URL | lush_wecom-0.1.1.tar.gz |
|---|---|
| Size | 46.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3031d55b4d31880dbc3816c34f94ed11d278a9ebc70d8b720022d5c0fd7cfe38
|
|
BLAKE2b-256 checksum How to use checksums |
7dbefb6f49de1add959564006b600dd263140e32b1765b9edeb42b9da6f00a5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / lush_wecom-0.1.1-py3-none-any.whl
| Download URL | lush_wecom-0.1.1-py3-none-any.whl |
|---|---|
| Size | 65.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bc87b7624767b405f43a1f0422b1ad3894be0861c3258a5b108356e0e42a605
|
|
BLAKE2b-256 checksum How to use checksums |
218f5e3be61f4e632ab09e4310c7997acfd56ca37f10a4612d48f004817e48ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for lush-wecom 0.1.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.