echotools
通用基础设施 SDK:配置中心、日志、事件总线、调用链、任务调度、 插件框架、协议系统、自适应选择器,完全项目无关,兼容 Python 3.8–3.14。
安装
# 核心(仅 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 -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。
快速开始
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 |
轮询文件监视 |
开发
pip install -e ".[dev,all]"
make lint
make test
make cov
模块指南见 docs/modules.md,API 参考见 docs/api.md。
许可证
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file echotools-2.3.97.tar.gz.
File metadata
- Download URL: echotools-2.3.97.tar.gz
- Upload date:
- Size: 353.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59b1c6dff285b9ee9c2bb8339d2166ac712350e56e6f2fd5447780e6a163e8b4
|
|
| MD5 |
77e47dad969851fcddabe818919a4af0
|
|
| BLAKE2b-256 |
7e10b261916b0d31ada99e126704baf52a7c01a1ac9657ec8a2baaecaa676722
|
File details
Details for the file echotools-2.3.97-py3-none-any.whl.
File metadata
- Download URL: echotools-2.3.97-py3-none-any.whl
- Upload date:
- Size: 454.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f2c8adbd0d518a51218a1b0ce06bb19121b90e873a279f4782a3f6d32f3258f
|
|
| MD5 |
a7b4665b43c0b1e63b6ab07a689c55df
|
|
| BLAKE2b-256 |
3339195bbc77b9a01188a64a101d157025effd9b567cbcf2cfcf2049aef45b05
|