mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 19:04:15 +08:00
## 1. 拼音首字母搜索 (同花顺式) 后端 search_instruments 新增拼音匹配层, 输入 payh 可命中「平安银行」。 - 辅助函数 _name_pinyin_keys 用 lru_cache 缓存「名称→首字母串」, 命中后 近似 dict 查找, 全市场遍历 < 1ms - 多音字用 heteronym 笛卡尔积展开, 「重庆」同时匹配 cq/zq 两种读音; 并加载 A 股高频地名词典 (重庆/长安/长春/长沙/长城/长江) - 拼音分支仅在纯 ASCII 字母输入时触发, 中文/数字搜索零开销跳过, 完全向后兼容 - 搜索分层: ① code/symbol 前缀 → ② 拼音首字母前缀 → ③ 包含匹配 新增依赖: pypinyin>=0.50 (纯 Python, 无 C 扩展) 新增测试: tests/test_instrument_search.py (15 用例覆盖拼音/多音字/兼容/边界) ## 2. 搜索结果显示板块徽标 自选/财务搜索/监控规则/回测选标的 四个搜索入口的结果项, 现在会显示 创业板(橙「创」)/科创板(青「科」)/北交所(紫「北」)彩色徽标。 - 复用项目既有的 boardTag (@/components/stock-table/primitives), 与自选/策略/Dashboard 表格徽标样式完全统一 - 沪深主板不显示徽标 (信息量低, 保持简洁) ## 验证 - 后端全量测试 503 passed (含新增 15) - 前端 tsc --noEmit 零错误
89 lines
2.6 KiB
TOML
89 lines
2.6 KiB
TOML
[project]
|
|
name = "tickflow-stock-panel-backend"
|
|
version = "0.1.83"
|
|
description = "A 股选股 + 监控 + 回测面板 — TickFlow 适配"
|
|
readme = "../README.md"
|
|
requires-python = ">=3.11"
|
|
license = { text = "MIT" }
|
|
dependencies = [
|
|
# Web
|
|
"fastapi>=0.115",
|
|
"uvicorn[standard]>=0.30",
|
|
"pydantic>=2.7",
|
|
"pydantic-settings>=2.4",
|
|
"python-multipart>=0.0.6",
|
|
"sse-starlette>=2.0",
|
|
# Data
|
|
"polars>=1.0",
|
|
"duckdb>=1.0",
|
|
"pyarrow>=16.0",
|
|
"pandas>=2.2", # 仅在 BacktestService 边界使用,见 §7.4 / ADR-19
|
|
"psutil>=5.9", # 独立回测 worker 的峰值 RSS 与退出后内存指标
|
|
# llvmlite 不再提供 macOS Intel wheel;该平台使用 Matrix 纯 Python fallback。
|
|
"numba>=0.65.1; sys_platform != 'darwin' or platform_machine != 'x86_64'",
|
|
"fastexcel>=0.10", # Polars 读取 xlsx/xls
|
|
"pypinyin>=0.50", # 股票名拼音首字母搜索 (同花顺式 payh → 平安银行)
|
|
# TickFlow 官方 SDK
|
|
"tickflow[all]>=0.1.23",
|
|
# Scheduling
|
|
"apscheduler>=3.10",
|
|
# Config
|
|
"pyyaml>=6.0",
|
|
"python-dotenv>=1.0",
|
|
# AI(可选,但默认装上)
|
|
"openai>=1.40", # OpenAI 兼容适配器复用 openai SDK
|
|
"httpx>=0.27",
|
|
"platformdirs>=4.0", # 桌面版用户数据目录 (跨平台持久可写)
|
|
"winotify>=1.1; sys_platform == 'win32'", # Windows 系统通知 (进操作中心)
|
|
"plyer>=2.1", # 系统通知跨平台兜底 (macOS/Linux)
|
|
# Watchlist screenshot OCR (Tesseract)
|
|
"pytesseract>=0.3.10",
|
|
"Pillow>=10.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
# Legacy CPU runtime: install the Polars compatibility kernel on
|
|
# machines without AVX2/FMA support.
|
|
# Enable with: uv sync --extra legacy-cpu
|
|
legacy-cpu = [
|
|
"polars[rtcompat]>=1.0",
|
|
]
|
|
|
|
# vectorbt 还会引入绘图、交互组件等完整分析栈,仍保持为可选 extras。
|
|
# Matrix 引擎只直接依赖上面的 numba/llvmlite 编译内核。
|
|
# 启用:`uv sync --extra backtest`
|
|
backtest = [
|
|
"vectorbt>=0.26",
|
|
]
|
|
|
|
# 桌面客户端依赖: pywebview 桌面窗口。打包用 (PyInstaller), 生产/Docker 不需要。
|
|
# 启用:`uv sync --extra desktop`
|
|
desktop = [
|
|
"pywebview>=5.0",
|
|
]
|
|
|
|
dev = [
|
|
"pytest>=8.0",
|
|
"pytest-asyncio>=0.23",
|
|
"ruff>=0.5",
|
|
"mypy>=1.10",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["app"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py311"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "N", "UP", "B", "SIM", "RUF"]
|
|
ignore = ["E501"] # 长行交给 fmt
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|