Metadata-Version: 2.4
Name: py-easy-tjbrhk
Version: 1.0.1
Summary: 天津博瑞晧科 Python SDK，提供简单易用的天津博瑞晧科 API 交互功能，支持发送通知等操作。
Home-page: https://gitee.com/guolei19850528/py_easy_tjbrhk
Author: guolei
Author-email: 174000902@qq.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx
Requires-Dist: jsonschema
Requires-Dist: jsonpath-ng
Requires-Dist: py-easy-httpx
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# py_easy_tjbrhk

天津博瑞晧科 Python SDK，提供简单易用的天津博瑞晧科 API 交互功能，支持发送通知等操作。

## 功能特性

- **通知发送**：支持同步和异步发送通知
- **灵活配置**：支持通过参数自定义客户端行为
- **响应处理**：提供 JSON 数据验证功能
- **同步/异步支持**：同时支持同步和异步操作
- **类型提示**：完整的类型注解，提供良好的 IDE 支持

## 安装

### 使用 pip 安装

```bash
pip install py_easy_tjbrhk
```

### 从源码安装

```bash
git clone https://gitee.com/guolei19850528/py_easy_tjbrhk.git
cd py_easy_tjbrhk
pip install -e .
```

## 依赖

- httpx
- py_easy_httpx

## 快速开始

### 同步发送通知

```python
from py_easy_tjbrhk.speaker import Speaker

# 初始化播报机器人客户端
speaker = Speaker(
    token="YOUR_TOKEN",
    id="YOUR_ID"
)

# 发送通知
response = speaker.notify(
    message="这是一条测试通知"
)
print(f"发送结果: {response}")
```

### 异步发送通知

```python
import asyncio
from py_easy_tjbrhk.speaker import Speaker

async def main():
    # 初始化播报机器人客户端
    speaker = Speaker(
        token="YOUR_TOKEN",
        id="YOUR_ID"
    )
    
    # 异步发送通知
    response = await speaker.async_notify(
        message="这是一条测试通知"
    )
    print(f"发送结果: {response}")

asyncio.run(main())
```

## API 文档

### Speaker 类

#### 初始化参数
- `base_url`: API 基础 URL，默认为 "https://speaker.17laimai.cn"
- `token`: 认证令牌
- `id`: 设备/用户 ID
- `version`: API 版本号，默认为 "1"
- `client_kwargs`: 传递给 httpx.Client 的额外参数

#### 方法
- `notify(client=None, message="", **kwargs)`: 同步发送通知
- `async_notify(client=None, message="", **kwargs)`: 异步发送通知

## 高级用法

### 自定义客户端配置

```python
from py_easy_tjbrhk.speaker import Speaker

# 初始化播报机器人客户端，自定义客户端配置
speaker = Speaker(
    token="YOUR_TOKEN",
    id="YOUR_ID",
    client_kwargs={
        "timeout": 30.0,  # 设置超时时间为 30 秒
        "headers": {
            "User-Agent": "py_easy_tjbrhk"
        }
    }
)

# 发送通知
response = speaker.notify(
    message="这是一条测试通知"
)
print(f"发送结果: {response}")
```

## 项目结构

```
py_easy_tjbrhk/
├── py_easy_tjbrhk/              # 主包目录
│   ├── __init__.py            # 包初始化文件
│   └── speaker.py             # 播报机器人模块
├── README.md                  # 项目文档
├── setup.py                   # 安装配置
├── requirements.txt           # 依赖列表
├── LICENSE                    # 许可证文件
├── deploy.sh                  # 部署脚本
├── .gitignore                 # Git 忽略文件
└── test_speaker.py            # 测试文件
```

## 测试

运行测试：

```bash
# 运行测试
python test_speaker.py
```

## 许可证

MIT License

## 贡献

欢迎提交 Issue 和 Pull Request！

## 联系方式

- 作者：guolei
- 邮箱：174000902@qq.com
- 项目地址：https://gitee.com/guolei19850528/py_easy_tjbrhk

## 致谢

- [httpx](https://www.python-httpx.org/) - 高性能的异步 HTTP 客户端库
- [py_easy_httpx](https://gitee.com/guolei19850528/py_easy_httpx) - 简化 HTTP 请求的工具包
