Skip to main content

通用钉钉消息推送工具

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


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

Yucebio_Notifier-0.0.3-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page