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

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

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

Uploaded Python 3

File details

Details for the file Yucebio_Notifier-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: Yucebio_Notifier-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for Yucebio_Notifier-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef06af45204afc2a144790db87ae59c4a8c4f8b80f65a214ed3c3996cf4f2c81
MD5 d82d6fecaac460b877df7bb6614eb8f8
BLAKE2b-256 908fd9e081fed02b9f18295114fd61c498b83889a9ef42c0f3bb0bed88533e25

See more details on using hashes here.

Supported by

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