Skip to main content

pynotices是什么?

是一个python3开发的发送信息模块

支持内容?

  • 支持非ssl和ssl的EMAIL
  • 钉钉webhook机器人
  • 企业微信自定义应用
  • 企业微信webhook机器人
  • 飞书webhook机器人

####TODO

  • 短信平台(主流)、微信方糖 、telegram

安装

  • 一步到胃
pip install pynotices
  • 多步安装

需要先安装requests模块

pip install requests

下载alter.py到你的项目,建议alter.py的目录有一个__init__.py的空白文件

使用

  • 钉钉webhook机器人
import pynotice
dtack = pynotice.DinTalk("e897e8fec**********") #webhook地址,只需要webhook=后面的值
ret = dtack.sendmessage("13996438187","消息") #发送的用户,以及发送的消息,多用户使用"user1|user2|user3"
if ret["errcode"]:
    print("发送成功")
else:
    print(ret["errmessage"])
  • EMAIL
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"])
  • 企业微信webhook机器人
import pynotice
wxbot = pynotice.weixinbot("eb0507ea-264b-***-******") #webhook地址,只需要webhook=后面的值
ret = wxbot.sendmessage("消息") #发送的消息
if ret["errcode"]:
    print("发送成功")
else:
    print(ret["errmessage"])
  • 飞书webhook机器人
import pynotice
fsbot = pynotice.FeiShu("eb0507ea-264b-***-******") #webhook地址,只需要webhook=后面的值
ret = fsbot.sendmessage("消息") #发送的消息
if ret["errcode"]:
    print("发送成功")
else:
    print(ret["errmessage"])

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynotices-1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynotices-1.1-py2-none-any.whl (4.7 kB view details)

Uploaded Python 2

File details

Details for the file pynotices-1.1.tar.gz.

File metadata

  • Download URL: pynotices-1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pynotices-1.1.tar.gz
Algorithm Hash digest
SHA256 d1ad631d8623b79c8744cade917eab66d9629532fb60d3db2f509f7b016119ec
MD5 32bc33d13c8e26a64b6340b9ff1ed3c9
BLAKE2b-256 d41b15ade07dad45a983e834f057e322e4a2e2831f6778a2273db8c8a8703cb9

See more details on using hashes here.

File details

Details for the file pynotices-1.1-py2-none-any.whl.

File metadata

  • Download URL: pynotices-1.1-py2-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 2
  • Uploaded using 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

File hashes

Hashes for pynotices-1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 31b7a8ce65d6298dbf210afb3e325bcab2dff299d08d4291fb7b092482d8e2b5
MD5 6191f2dd4ba3623b351d3c2ec7dc9a27
BLAKE2b-256 3e1cee16fd60a8cd72471fa640cb3aa21a7540c032d301ac0179a4eb65433b1e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page