Skip to main content

No project description provided

Project description

用 Python 发送企业微信消息

支持发送:

  • 文本
  • 文件
  • 图片
  • MarkDown

安装

pip install wechat-enterprise-sdk

使用

获取的 access_token 会保存在 ./tmp/cache.json 里面,避免高频率获取 access_token。

from wechat_enterprise import WechatEnterprise
we = WechatEnterprise(
    corpid="ww2563f***********",  # 企业 ID
    appid="100****3",  # 企业应用 ID
    corpsecret="*********************",  # 企业应用 Secret
)

#接收者 ID,在企业微信通讯录中查看
receivers = ["ZhengZheng", "DaZhengGe"]
# 发送 文本
we.send_text("来息 somenzz 的消息", receivers)
# 发送 Markdown
we.send_markdown("# Markdown", receivers)
# 发送图片
we.send_image("/Users/aaron/Downloads/images.jpeg", receivers)
# 发送文件
we.send_file("./wechat_enterprise.py", receivers)

todo

添加企业微信的其他实用功能

联系我

添加微信 「somenzz」 备注 「github」

个人公众号 「Python七号」,微信搜一搜关注。

Project details


Download files

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

Source Distribution

wechat_enterprise_sdk-0.4.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

wechat_enterprise_sdk-0.4-py3-none-any.whl (5.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