Metadata-Version: 2.4
Name: vorto-utils
Version: 0.2.2
Summary: Vorto plugin utility toolkit: QingLong client, MaPay client, QR code generator, payment config reader.
Author-email: Vorto <metwhale@gmail.com>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://github.com/Vorto/vorto-utils
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.20.0
Dynamic: license-file

# vorto-utils

Vorto 插件公共工具包，提供青龙面板操作、码支付、二维码生成、支付配置读取等通用功能。

当前版本：0.1.9

## 安装

```bash
pip install vorto-utils
```

## 快速使用

```python
from vorto_utils import (
    generate_qrcode_url,
    get_pay_config,
    QingLongClient,
    DumbPanelClient,
    MaPayClient,
)

# 生成二维码
url = generate_qrcode_url("https://example.com")

# 读取支付配置
config = get_pay_config()

# 青龙面板操作
ql = QingLongClient("S_NKF", "http://host:5700丨client_id丨client_secret")
ql.update_env("13800138000", "phone#token#unifyId", "备注信息")

# DumbPanel 操作（支持 group 分组参数）
dp = DumbPanelClient("S_NKF", "http://host:8000丨app_key丨app_secret")
dp.update_env("13800138000", "phone#token#unifyId", "备注信息", group="顺丰")

# 码支付
client = MaPayClient(gateway="https://pay.example.com", pid="1001", key="your_key")
result = client.create_order(8.88, "alipay", "order_123", "商品名称")
```

## 模块说明

| 模块 | 功能 |
|------|------|
| `qrcode` | 二维码图片URL生成 |
| `pay_config` | 从 middleware 读取支付方式配置 |
| `qinglong` | 青龙面板环境变量 CRUD |
| `dumbpanel` | DumbPanel 环境变量 CRUD（支持 group） |
| `mapay` | 码支付下单、查单、验单 |

## 发布

项目根目录提供 PowerShell 发布脚本：`publish.ps1`。

示例：

```powershell
$env:TWINE_TOKEN = "pypi-..."
.\publish.ps1 -Version 0.1.10
```
