pynotices是什么?
是一个python3开发的发送信息模块
支持内容?
- 支持非ssl和ssl的EMAIL
- 钉钉webhook机器人
- 企业微信自定义应用
- 企业微信webhook机器人
- 飞书webhook机器人
####TODO
- 短信平台(主流)、微信方糖 、telegram
安装
pip install pynotices
需要先安装requests模块
pip install requests
下载alter.py到你的项目,建议alter.py的目录有一个__init__.py的空白文件
使用
import pynotice
dtack = pynotice.DinTalk("e897e8fec**********") #webhook地址,只需要webhook=后面的值
ret = dtack.sendmessage("13996438187","消息") #发送的用户,以及发送的消息,多用户使用"user1|user2|user3"
if ret["errcode"]:
print("发送成功")
else:
print(ret["errmessage"])
import pynotice
smtp = pynotice.Email("发件人账号","发件人密码",smtp = "smtp地址",smtp_port="smtp端口 int",smtp_ssl=False)#默认ssl是True
ret = smtp.sendmessage("收件人账号",'标题','内容')
if ret["errcode"]:
print("发送成功")
else:
print(ret["errmessage"])
import pynotice
corpid = "企业的ID"
secret = "自定义应用secret"
agentid = "自定义应用agentid"
webcat = pynotice.WeiXin(corpid,secret,agentid)
ret = webcat.sendmessage("消息接受者(在企业微信后台查看的账号)", "发送内容")
if ret["errcode"]:
print("发送成功")
else:
print(ret["errmessage"])
import pynotice
wxbot = pynotice.weixinbot("eb0507ea-264b-***-******") #webhook地址,只需要webhook=后面的值
ret = wxbot.sendmessage("消息") #发送的消息
if ret["errcode"]:
print("发送成功")
else:
print(ret["errmessage"])
import pynotice
fsbot = pynotice.FeiShu("eb0507ea-264b-***-******") #webhook地址,只需要webhook=后面的值
ret = fsbot.sendmessage("消息") #发送的消息
if ret["errcode"]:
print("发送成功")
else:
print(ret["errmessage"])
Release files for pynotices 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 | |
|---|---|---|---|
| pynotices-1.1.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pynotices-1.1-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 9.4 kB
Release files / pynotices-1.1.tar.gz
| Download URL | pynotices-1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1ad631d8623b79c8744cade917eab66d9629532fb60d3db2f509f7b016119ec
|
|
BLAKE2b-256 checksum How to use checksums |
d41b15ade07dad45a983e834f057e322e4a2e2831f6778a2273db8c8a8703cb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6
|
Release files / pynotices-1.1-py2-none-any.whl
| Download URL | pynotices-1.1-py2-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
31b7a8ce65d6298dbf210afb3e325bcab2dff299d08d4291fb7b092482d8e2b5
|
|
BLAKE2b-256 checksum How to use checksums |
3e1cee16fd60a8cd72471fa640cb3aa21a7540c032d301ac0179a4eb65433b1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6
|