通用消息推送模块
- 支持发送给企业员工钉钉消息 和 钉钉群消息
支持发送邮件
安装
# 初始化环境,如通过conda初始化python>=3.8的环境
conda create -n python3.8 python=3.8
# 安装依赖包
pip install click icecream alibabacloud-dingtalk
# 安装
pip install -i https://test.pypi.org/simple/ Yucebio-Notifier
Usage
from yucebio_notifier import Notifier
# dingding, dingding-rebot
notifier = Notifier(backend='dingding')
notifier.send_message(
user, # 接受人员
title, # 消息主题、标题 或 简短消息
markdown, # markdown格式的复杂格式消息。可以通过 yucebio_notifier.utils.markdown.Markdown 创建
)
参考内容
钉钉消息
文本消息
{
"msgtype": "text",
"content": "一句话消息"
}
markdown消息
{
"msgtype": "markdown",
"markdown": {
"title": "",
"text": "str(Markdown(...))"
}
}
配置 yucebio_notifier config-dingding
- corpid 钉钉开发者平台分配给企业的ID
- corpsecret 钉钉开发者平台分配给企业的Seccrect
- agent_id 发送消息时使用的微应用的AgentID
Release files for Yucebio-Notifier 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Yucebio_Notifier-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / Yucebio_Notifier-0.0.3-py3-none-any.whl
| Download URL | Yucebio_Notifier-0.0.3-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef06af45204afc2a144790db87ae59c4a8c4f8b80f65a214ed3c3996cf4f2c81
|
|
BLAKE2b-256 checksum How to use checksums |
908fd9e081fed02b9f18295114fd61c498b83889a9ef42c0f3bb0bed88533e25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|