No project description provided
Project description
用 Python 发送企业微信消息
支持发送:
- 文本
- 文件
- 图片
- MarkDown
安装
pip install wechat-enterprise-sdk
使用
获取的 access_token 会保存在 ./tmp/cache.json 里面,避免高频率获取 access_token。
from wechat_enterprise import WechatEnterprise
we = WechatEnterprise(
corpid="ww2563f***********", # 企业 ID
appid="100****3", # 企业应用 ID
corpsecret="*********************", # 企业应用 Secret
)
#接收者 ID,在企业微信通讯录中查看
receivers = ["ZhengZheng", "DaZhengGe"]
# 发送 文本
we.send_text("来息 somenzz 的消息", receivers)
# 发送 Markdown
we.send_markdown("# Markdown", receivers)
# 发送图片
we.send_image("/Users/aaron/Downloads/images.jpeg", receivers)
# 发送文件
we.send_file("./wechat_enterprise.py", receivers)
# 根据手机号获取企业微信账号:
userid = we.get_userid("138********")
we.send_text("hello",[userid,])
todo
添加企业微信的其他实用功能
联系我
添加微信 「somenzz-enjoy」 备注 「github」
个人公众号 「Python七号」,微信搜一搜关注。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wechat_enterprise_sdk-0.4.2.tar.gz
.
File metadata
- Download URL: wechat_enterprise_sdk-0.4.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 285ff4435cc6175f8a070e7894f67e88a1ba6d69f3cf770b9543de55e29519f4 |
|
MD5 | 77e8f4956f4c6ea44e40950841bb6b78 |
|
BLAKE2b-256 | dbc249a9b044a67084fdbf161c74ae635664986ecb93b721de5b31bceb89621b |
File details
Details for the file wechat_enterprise_sdk-0.4.2-py3-none-any.whl
.
File metadata
- Download URL: wechat_enterprise_sdk-0.4.2-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 893ca3c1f620918ef0ed697e0c37253c2e02d33e3efd279a58f196e6bc67da43 |
|
MD5 | 60755ecaf40e949c675cd6f29eaf5ef9 |
|
BLAKE2b-256 | 10e20daeeebf88087a1da4256229a7a9aa32e4bbf24da5d48fbcaa5e28454e7e |