Skip to main content

A simple SDK for sending messages through Luke's WeCom application.

Project description

luke_qywechat

luke 的企业微信 SDK,用于通过企业微信应用给企业成员发送消息。

安装

pip install luke_qywechat

使用

只需要传入企业微信应用的 agentIdsecret

from qy_wechat import WeChatPub

wechat = WeChatPub(agentId=1000001, secret="your-secret")
wechat.send_msg("hello")

兼容旧写法:

wechat = WeChatPub(1000001, "your-secret")
wechat.send_msg("hello", d_ids="5")

发送图片

wechat.send_image_msg("/path/to/image.jpg")
wechat.send_image_msg("https://example.com/image.jpg")

命令行测试

不要把 agentIdsecret 写进代码或提交到仓库。命令行测试可以使用环境变量:

export QY_WECHAT_AGENT_ID=1000001
export QY_WECHAT_SECRET=your-secret
qy-wechat "测试消息"

发布到 PyPI

本项目不会在包内保存 agentIdsecret 或 PyPI token。发布前请使用环境变量或本机 keyring 管理令牌。

python -m build
python -m twine check dist/*
python -m twine upload dist/*

如果使用 token:

export TWINE_USERNAME=__token__
export TWINE_PASSWORD=<your API token>
python -m twine upload dist/*

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

luke_qywechat-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

luke_qywechat-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file luke_qywechat-0.1.0.tar.gz.

File metadata

  • Download URL: luke_qywechat-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for luke_qywechat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3877c279152bd4cd8708a94ab6c7dc995978fc3eede64f6aefe2c964f5da316
MD5 7e5e3ba8502735f436b95e5edc02b66e
BLAKE2b-256 4d2fc841a888b06f97295f83eb03364665b237a6b05cdf090acf545d00626512

See more details on using hashes here.

File details

Details for the file luke_qywechat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: luke_qywechat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for luke_qywechat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd435b3d88a8027259a1f13225259ac995c9449496f0ec55628b963dcd42d73
MD5 6624d78aa236f440166d6f4a756e9228
BLAKE2b-256 f48b92f7c4c772e940c3c42eb3d38ce301ea0aad2a67ab6706d805f248e4aed1

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