通用钉钉消息推送工具
Project description
通用消息推送模块
- 支持发送给企业员工钉钉消息 和 钉钉群消息
支持发送邮件
安装
# 初始化环境,如通过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
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for Yucebio_Notifier-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef06af45204afc2a144790db87ae59c4a8c4f8b80f65a214ed3c3996cf4f2c81 |
|
MD5 | d82d6fecaac460b877df7bb6614eb8f8 |
|
BLAKE2b-256 | 908fd9e081fed02b9f18295114fd61c498b83889a9ef42c0f3bb0bed88533e25 |