Metadata-Version: 2.4
Name: luke_qywechat
Version: 0.1.0
Summary: A simple SDK for sending messages through Luke's WeCom application.
Author: Luke
License-Expression: MIT
Project-URL: Homepage, https://github.com/luke9012/luke_qywechat
Keywords: wecom,wechat-work,qywechat,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: Chat
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0

# luke_qywechat

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

## 安装

```bash
pip install luke_qywechat
```

## 使用

只需要传入企业微信应用的 `agentId` 和 `secret`：

```python
from qy_wechat import WeChatPub

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

兼容旧写法：

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

## 发送图片

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

## 命令行测试

不要把 `agentId` 和 `secret` 写进代码或提交到仓库。命令行测试可以使用环境变量：

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

## 发布到 PyPI

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

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

如果使用 token：

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