Metadata-Version: 2.4
Name: echotools
Version: 2.3.88
Summary: 通用基础设施 SDK：配置、日志、事件、调度、插件、协议、调用链
Home-page: https://github.com/nichengfuben/echotools
Author: nichengfuben
License: MIT
Project-URL: Homepage, https://github.com/nichengfuben/echotools
Project-URL: Repository, https://github.com/nichengfuben/echotools
Project-URL: Issues, https://github.com/nichengfuben/echotools/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: typing-extensions>=4.7.0
Provides-Extra: toml
Requires-Dist: tomlkit>=0.11.0; extra == "toml"
Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "toml"
Provides-Extra: watch
Requires-Dist: watchdog>=3.0.0; extra == "watch"
Provides-Extra: http
Requires-Dist: aiohttp>=3.8.0; extra == "http"
Provides-Extra: socks
Requires-Dist: aiohttp-socks>=0.8.0; extra == "socks"
Provides-Extra: ssh
Requires-Dist: paramiko>=3.0.0; extra == "ssh"
Provides-Extra: terminal
Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "terminal"
Provides-Extra: console
Requires-Dist: rich>=13.0; extra == "console"
Requires-Dist: wcwidth>=0.2; extra == "console"
Provides-Extra: all
Requires-Dist: tomlkit>=0.11.0; extra == "all"
Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "all"
Requires-Dist: watchdog>=3.0.0; extra == "all"
Requires-Dist: aiohttp>=3.8.0; extra == "all"
Requires-Dist: aiohttp-socks>=0.8.0; extra == "all"
Requires-Dist: paramiko>=3.0.0; extra == "all"
Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "all"
Requires-Dist: rich>=13.0; extra == "all"
Requires-Dist: wcwidth>=0.2; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"

# echotools

通用基础设施 SDK：配置中心、日志、事件总线、调用链、任务调度、
插件框架、协议系统、自适应选择器，完全项目无关，兼容 Python 3.8–3.14。

## 安装

```bash
# 核心（仅 typing-extensions）
pip install echotools

# 完整功能
pip install echotools[all]
```

### 可选依赖

| Extra | 用途 |
|-------|------|
| `toml` | TOML 配置读写 |
| `watch` | watchdog 文件监视 |
| `http` | aiohttp Web 层 |
| `socks` | SOCKS 代理 |
| `ssh` | SSH 终端 |
| `terminal` | Windows ConPTY |
| `all` | 全部可选依赖 |
| `dev` | pytest, ruff, mypy |

### PyPI 重装（`uninstall-no-record-file`）

本地 `pip install -e .` 或中断的 wheel 安装可能留下无 `RECORD` 的元数据，导致
`pip install --upgrade echotools` 报 `Cannot uninstall echotools None`。

```powershell
# 在仓库根目录
powershell -File scripts/reinstall_from_pypi.ps1 -Version 2.3.81
```

或手动：删除 `src/echotools.egg-info` 与 site-packages 里仅有 `direct_url.json` 的
`echotools-*.dist-info`，再执行
`pip install --force-reinstall --no-cache-dir echotools==2.3.81`。

## 快速开始

```python
from echotools import EchoTools

et = EchoTools(service_name="myapp")
et.logger.configure(level="INFO", color=True)
cfg = et.config
cfg.load("config.toml")

with et.tracer.trace("request") as trace:
    with et.tracer.span(trace, "db") as span:
        span.set_tag("query", "select 1")

await et.shutdown()
```

## 能力总览

| 模块 | 说明 |
|------|------|
| `ConfigCenter` | 点路径配置 + 热重载 + 类型绑定 |
| `LoggerManager` | 调用链注入 + 颜色 + 轮转 |
| `EventBus` | 同步/异步事件 |
| `Tracer` | 轻量调用链 |
| `TaskDispatcher` | 单发/竞速 + 贝叶斯自适应选择 |
| `PluginRegistry` | 自动发现 + 热重载 |
| `get_protocol` | XML/antml/original/bracket/nous 等 LLM 工具协议 |
| `ProxyManager` | HTTP/HTTPS/SOCKS |
| `AutoUpdater` | git 自动更新 |
| `FileWatcher` | 轮询文件监视 |

## 开发

```bash
pip install -e ".[dev,all]"
make lint
make test
make cov
```

模块指南见 [docs/modules.md](docs/modules.md)，API 参考见 [docs/api.md](docs/api.md)。

## 许可证

MIT
