Metadata-Version: 2.4
Name: base-tools
Version: 0.1.10
Summary: A collection of Python utility modules for file, string, encoding, network, logging, audio, and more.
Project-URL: Homepage, https://gitee.com/AuspiciousChan/base-tools
Project-URL: Issues, https://gitee.com/AuspiciousChan/base-tools/issues
Author-email: AuspiciousChan <AuspiciousChan@163.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: aioquic
Requires-Dist: gitpython
Requires-Dist: httpx
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: paramiko
Requires-Dist: pycryptodome
Requires-Dist: websockets
Description-Content-Type: text/markdown

# base-tools

#### 介绍

`base-tools` 是一套 Python 基础工具库，帮助开发者快速实现文件操作、字符串处理、编解码、网络通信、日志记录、音频合成等常见功能。所有工具类统一放在 `cjlutils` 包下，可按需导入使用。

#### 环境要求

- Python >= 3.10

#### 安装

```shell
pip install base-tools
```

安装指定版本：

```shell
pip install base-tools==0.1.10
```

#### 模块一览

| 模块 | 说明 |
|------|------|
| `AdbUtil` | Android Debug Bridge 常用操作封装 |
| `BytesUtil` | 字节流与整数列表互转 |
| `CryptoUtil` | AES、RSA、哈希、签名等加解密工具 |
| `DictUtil` | **已废弃**，请使用 `MappingUtil` |
| `EncodeUtil` | MD5、Base64、URL 编解码 |
| `FileUtil` | 文件/目录创建、读写、压缩、路径处理 |
| `FtpUtil` | FTP 客户端常用操作 |
| `GitUtil` | Git 仓库克隆、提交、Stash 等封装 |
| `HttpUtil` | HTTP 请求封装 |
| `LipoUtil` | macOS/iOS `lipo` 命令封装 |
| `ListUtil` | **已废弃**，请使用 `SequenceUtil` |
| `LogUtil` | 线程安全日志，支持文件截断/轮转/按天切分 |
| `LogicUtil` | 常用逻辑运算工具 |
| `MappingUtil` | 通用映射类型（dict、defaultdict 等）操作 |
| `PyplotUtil` | matplotlib 绘图简化封装 |
| `QuicUtil` | QUIC 协议客户端操作 |
| `ScpUtil` | SCP 文件传输封装 |
| `SequenceUtil` | 通用序列类型（list、tuple、str 等）操作 |
| `SoundUtil` | 音频波形合成、ADSR 包络、和弦生成 |
| `SshUtil` | SSH 连接与命令执行 |
| `StringUtil` | 字符串查找、编码转换、驼峰/蛇形命名转换 |
| `TcpUtil` | TCP 服务端/客户端封装 |
| `TimeUtil` | 时间格式化、转换、计时等 |
| `UdpUtil` | UDP 服务端/客户端封装 |
| `WebsocketUtil` | WebSocket 服务端/客户端封装 |

#### 使用示例

```python
from cjlutils import FileUtil, StringUtil, LogUtil, SequenceUtil

# 文件操作
FileUtil.create_file('./temp/readme.txt', 'hello world', create_parent=True)

# 字符串操作
print(StringUtil.to_camel_case('my_variable_name'))  # myVariableName

# 日志记录（默认输出到标准输出和 ./logs/app.log）
LogUtil.i('MAIN', 'application started')

# 序列操作（兼容 list、tuple、str）
print(SequenceUtil.distinct([1, 2, 2, 3]))  # [1, 2, 3]
```

#### 运行测试

```shell
PYTHONPATH=$(pwd) python -m unittest discover -s test -p "*Test.py" -v
```

#### 参与贡献

1. Fork 本仓库
2. 新建 `Feat_xxx` 分支
3. 提交代码
4. 新建 Pull Request
