发送企业微信应用消息
Project description
msgqywx
使用企业微信的应用消息推送实时信息
注:markdown支持无法在微信中查看
Install
pip install git+https://github.com/veinkr/msgqywx.git
Params
- corpid: 企业ID,在管理后台获取
- corpsecret: 自建应用的Secret,每个自建应用里都有单独的secret
- agentid: 应用ID,在后台应用中获取
- touser: 接收者用户名(微信账号),多个用户用|分割,与发送消息的touser至少存在一个
Usage
from msgqywx import msgqywx
if __name__ == '__main__':
wx = msgqywx(corpid='ww7e42424723224ba8ff49',
corpsecret='we0YB4242424242_J2332PnmA',
agentid='2115353',
touser='xxxxxxxxxx',
)
wx.send_msg("这是测试信息") # 使用初始类的touser
wx.send_msg("这是另一个测试消息", touser="xxxxx") # 自定义接收的账号
md_text = """您的会议室已经预定,稍后会同步到`邮箱`
>**事项详情**
>事 项:<font color=\"info\">开会</font>
>组织者:@miglioguan
>参与者:@miglioguan、@kunliu、@jamdeezhou、@kanexiong、@kisonwang
>
>会议室:<font color=\"info\">广州TIT 1楼 301</font>
>日 期:<font color=\"warning\">2018年5月18日</font>
>时 间:<font color=\"comment\">上午9:00-11:00</font>
>
>请准时参加会议。
>
>如需修改会议信息,请点击:[修改会议信息](https://work.weixin.qq.com)"""
wx.send_msg(md_text, msgtype="markdown", raise_error=True) # 发送markdown消息,注意markdown消息仅企业微信可接收
Limit
基础频率
每企业调用单个cgi/api不可超过1万次/分,15万次/小时;
每ip调用单个cgi/api不可超过2万次/分,60万次/小时;
第三方应用提供商每ip调用单个cgi/api不可超过4万次/分,120万次/小时;
发送应用消息频率
每应用不可超过帐号上限数*200人次/天(注:若调用api一次发给1000人,算1000人次;若企业帐号上限是500人,则每个应用每天可发送100000人次的消息);
每应用对同一个成员不可超过30次/分钟,超过部分会被丢弃不下发;
发消息频率不计入基础频率;
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
msgqywx-0.2.0.tar.gz
(4.7 kB
view details)
Built Distributions
File details
Details for the file msgqywx-0.2.0.tar.gz
.
File metadata
- Download URL: msgqywx-0.2.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b79e5318e19ad1ef6bd5be0fa5c611d9d1387b1e92028d529d775166194b79d1 |
|
MD5 | 1e2f7db1c65f4cdcb4c3a9f6abffd50c |
|
BLAKE2b-256 | f34548e6ed43a57fcec2e7ebda3502d4f0de987286f9c67d7421b0846732af57 |
File details
Details for the file msgqywx-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: msgqywx-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19bd3be0fd94ae7823de7abf25870fcda2c87cedf31e75db8d433487c55295d7 |
|
MD5 | 998c266e4681a833fef063dec5d89f6b |
|
BLAKE2b-256 | cb4b41d98abb5b4dcd8aa7099b4a171b289387847eeeb270e8e70684897ed8cd |
File details
Details for the file msgqywx-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: msgqywx-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98ea4464a8e17306ba677653c2590baac6f00fb5a2574bcb8805210d24d29b15 |
|
MD5 | e3f6153653e70c70be0b77915cabd7ec |
|
BLAKE2b-256 | 713a75671f22606d35a50591a5817d9f0ddc36fddeb3a3ef31e128a676e80a54 |