mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 22:34:18 +08:00
将可选数据源改为插件化架构: 插件代码放 backend/app/plugins/<name>/, 用户在设置页点击安装依赖, 主仓库不背运行时依赖(nodejs 等)。 架构: - loader.py 新增 _load_builtin_plugins() 扫描 plugins/ 目录, 通过 plugin.yaml 清单动态发现并注册插件(委托自检 + 优雅降级) - runtime 字段支持 node/python, 安装/卸载分别用 npm/pip - 现有 tickflow + YAML 自定义源逻辑 100% 保留, 插件是叠加层 stock-sdk 插件 (plugins/stocksdk/): - 原始实现来自 @forrany 的 PR #57, 迁移到插件化架构, 署名保留 - Node 桥接 (bridge.py/mjs) + Python provider, 覆盖日K/除权/分钟/实时 - 设置页主列表直接显示: 未装灰显+安装按钮, 装完可切换/卸载 配套: - instrument_sync: 通用增强, 任何 provider 都能提供标的维表 - install/uninstall: uv 优先回退 pip, 容错坏 uv.toml + 国内镜像 - 10 例单测全过, tsc 零错误
37 lines
693 B
Python
37 lines
693 B
Python
"""Custom data source extension points."""
|
|
from app.data_providers.custom.loader import (
|
|
data_sources_dir,
|
|
delete_config,
|
|
errors,
|
|
get_config_dict,
|
|
get_provider,
|
|
install_plugin,
|
|
is_builtin,
|
|
is_custom_provider,
|
|
list_plugins,
|
|
list_sources,
|
|
load_all,
|
|
names,
|
|
provider_has_dataset,
|
|
save_config,
|
|
uninstall_plugin,
|
|
)
|
|
|
|
__all__ = [
|
|
"data_sources_dir",
|
|
"delete_config",
|
|
"errors",
|
|
"get_config_dict",
|
|
"get_provider",
|
|
"install_plugin",
|
|
"is_builtin",
|
|
"is_custom_provider",
|
|
"list_plugins",
|
|
"list_sources",
|
|
"load_all",
|
|
"names",
|
|
"provider_has_dataset",
|
|
"save_config",
|
|
"uninstall_plugin",
|
|
]
|