quantcli 0.1.11__tar.gz → 0.1.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. {quantcli-0.1.11/quantcli.egg-info → quantcli-0.1.13}/PKG-INFO +1 -1
  2. {quantcli-0.1.11 → quantcli-0.1.13}/pyproject.toml +4 -1
  3. quantcli-0.1.13/quantcli/factors/alpha101/alpha_001.yaml +6 -0
  4. quantcli-0.1.13/quantcli/factors/alpha101/alpha_002.yaml +6 -0
  5. quantcli-0.1.13/quantcli/factors/alpha101/alpha_003.yaml +6 -0
  6. quantcli-0.1.13/quantcli/factors/alpha101/alpha_004.yaml +6 -0
  7. quantcli-0.1.13/quantcli/factors/alpha101/alpha_005.yaml +6 -0
  8. quantcli-0.1.13/quantcli/factors/alpha101/alpha_006.yaml +6 -0
  9. quantcli-0.1.13/quantcli/factors/alpha101/alpha_007.yaml +6 -0
  10. quantcli-0.1.13/quantcli/factors/alpha101/alpha_008.yaml +6 -0
  11. quantcli-0.1.13/quantcli/factors/alpha101/alpha_009.yaml +6 -0
  12. quantcli-0.1.13/quantcli/factors/alpha101/alpha_010.yaml +6 -0
  13. quantcli-0.1.13/quantcli/factors/alpha101/alpha_011.yaml +6 -0
  14. quantcli-0.1.13/quantcli/factors/alpha101/alpha_012.yaml +6 -0
  15. quantcli-0.1.13/quantcli/factors/alpha101/alpha_013.yaml +6 -0
  16. quantcli-0.1.13/quantcli/factors/alpha101/alpha_014.yaml +6 -0
  17. quantcli-0.1.13/quantcli/factors/alpha101/alpha_015.yaml +6 -0
  18. quantcli-0.1.13/quantcli/factors/alpha101/alpha_016.yaml +6 -0
  19. quantcli-0.1.13/quantcli/factors/alpha101/alpha_017.yaml +6 -0
  20. quantcli-0.1.13/quantcli/factors/alpha101/alpha_018.yaml +6 -0
  21. quantcli-0.1.13/quantcli/factors/alpha101/alpha_019.yaml +6 -0
  22. quantcli-0.1.13/quantcli/factors/alpha101/alpha_020.yaml +6 -0
  23. quantcli-0.1.13/quantcli/factors/alpha101/alpha_021.yaml +6 -0
  24. quantcli-0.1.13/quantcli/factors/alpha101/alpha_022.yaml +6 -0
  25. quantcli-0.1.13/quantcli/factors/alpha101/alpha_023.yaml +6 -0
  26. quantcli-0.1.13/quantcli/factors/alpha101/alpha_024.yaml +6 -0
  27. quantcli-0.1.13/quantcli/factors/alpha101/alpha_025.yaml +6 -0
  28. quantcli-0.1.13/quantcli/factors/alpha101/alpha_026.yaml +6 -0
  29. quantcli-0.1.13/quantcli/factors/alpha101/alpha_027.yaml +6 -0
  30. quantcli-0.1.13/quantcli/factors/alpha101/alpha_028.yaml +6 -0
  31. quantcli-0.1.13/quantcli/factors/alpha101/alpha_029.yaml +6 -0
  32. quantcli-0.1.13/quantcli/factors/alpha101/alpha_030.yaml +6 -0
  33. quantcli-0.1.13/quantcli/factors/alpha101/alpha_031.yaml +6 -0
  34. quantcli-0.1.13/quantcli/factors/alpha101/alpha_032.yaml +6 -0
  35. quantcli-0.1.13/quantcli/factors/alpha101/alpha_033.yaml +6 -0
  36. quantcli-0.1.13/quantcli/factors/alpha101/alpha_034.yaml +6 -0
  37. quantcli-0.1.13/quantcli/factors/alpha101/alpha_035.yaml +6 -0
  38. quantcli-0.1.13/quantcli/factors/alpha101/alpha_036.yaml +6 -0
  39. quantcli-0.1.13/quantcli/factors/alpha101/alpha_037.yaml +6 -0
  40. quantcli-0.1.13/quantcli/factors/alpha101/alpha_038.yaml +6 -0
  41. quantcli-0.1.13/quantcli/factors/alpha101/alpha_039.yaml +6 -0
  42. quantcli-0.1.13/quantcli/factors/alpha101/alpha_040.yaml +6 -0
  43. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/utils/path.py +21 -18
  44. {quantcli-0.1.11 → quantcli-0.1.13/quantcli.egg-info}/PKG-INFO +1 -1
  45. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli.egg-info/SOURCES.txt +40 -0
  46. {quantcli-0.1.11 → quantcli-0.1.13}/LICENSE +0 -0
  47. {quantcli-0.1.11 → quantcli-0.1.13}/README.md +0 -0
  48. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/cli.py +0 -0
  49. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/core/__init__.py +0 -0
  50. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/core/backtest.py +0 -0
  51. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/core/data.py +0 -0
  52. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/core/factor.py +0 -0
  53. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/__init__.py +0 -0
  54. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/akshare.py +0 -0
  55. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/baostock.py +0 -0
  56. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/base.py +0 -0
  57. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/cache.py +0 -0
  58. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/fundamentals/__init__.py +0 -0
  59. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/fundamentals/provider.py +0 -0
  60. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/mixed.py +0 -0
  61. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/mysql.py +0 -0
  62. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/sync/__init__.py +0 -0
  63. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/sync/akshare.py +0 -0
  64. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/sync/base.py +0 -0
  65. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/sync/gm.py +0 -0
  66. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/datasources/sync/gm_fundamental.py +0 -0
  67. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/__init__.py +0 -0
  68. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/base.py +0 -0
  69. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/compute.py +0 -0
  70. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/loader.py +0 -0
  71. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/pipeline.py +0 -0
  72. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/ranking.py +0 -0
  73. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/ranking_executor.py +0 -0
  74. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/screening.py +0 -0
  75. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/factors/screening_executor.py +0 -0
  76. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/models/bar.py +0 -0
  77. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/parser/__init__.py +0 -0
  78. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/parser/constants.py +0 -0
  79. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/parser/formula.py +0 -0
  80. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/utils/__init__.py +0 -0
  81. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/utils/env.py +0 -0
  82. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/utils/logger.py +0 -0
  83. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/utils/symbol_utils.py +0 -0
  84. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/utils/time.py +0 -0
  85. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli/utils/validate.py +0 -0
  86. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli.egg-info/dependency_links.txt +0 -0
  87. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli.egg-info/entry_points.txt +0 -0
  88. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli.egg-info/requires.txt +0 -0
  89. {quantcli-0.1.11 → quantcli-0.1.13}/quantcli.egg-info/top_level.txt +0 -0
  90. {quantcli-0.1.11 → quantcli-0.1.13}/setup.cfg +0 -0
  91. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_akshare_integration.py +0 -0
  92. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_builtin_factors.py +0 -0
  93. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_cli.py +0 -0
  94. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_datasources.py +0 -0
  95. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_factors.py +0 -0
  96. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_gm_executors.py +0 -0
  97. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_mixed_datasource.py +0 -0
  98. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_multi_factor.py +0 -0
  99. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_pipeline_integration.py +0 -0
  100. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_symbol_utils.py +0 -0
  101. {quantcli-0.1.11 → quantcli-0.1.13}/tests/test_time.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantcli
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Summary: 面向AI的多因子量化选股策略挖掘工具,AI Agent 友好 CLI
5
5
  Author-email: QuantCLI Team <quantcli@example.com>
6
6
  Project-URL: repository, https://github.com/wumu2013/quantcli
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quantcli"
7
- version = "0.1.11"
7
+ version = "0.1.13"
8
8
  description = "面向AI的多因子量化选股策略挖掘工具,AI Agent 友好 CLI"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -48,6 +48,9 @@ where = ["."]
48
48
  include = ["quantcli*"]
49
49
  exclude = ["tests*"]
50
50
 
51
+ [tool.setuptools.package-data]
52
+ quantcli = ["factors/alpha101/*.yaml", "factors/*.yaml"]
53
+
51
54
  [tool.pytest.ini_options]
52
55
  testpaths = ["tests"]
53
56
  python_files = ["test_*.py"]
@@ -0,0 +1,6 @@
1
+ name: ALPHA_001 经典反转因子
2
+ type: technical
3
+ expr: "rank(ts_argmax(where(close == delay(close, 1), 0, close), 20)) - 0.5"
4
+ direction: positive
5
+ category: reversal
6
+ description: "20日创新高后转跌"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_002 阴线放量反转因子
2
+ type: technical
3
+ expr: "where(close < open, volume, -volume) / (ma(volume, 20) + 1)"
4
+ direction: positive
5
+ category: reversal
6
+ description: "下跌放量见底"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_003 低波动率因子
2
+ type: technical
3
+ expr: "ts_rank(ts_decayexp(close, 7), 10) - ts_rank(ts_decayexp(close, 20), 30)"
4
+ direction: positive
5
+ category: volatility
6
+ description: "低波动稳定"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_004 资金流向因子
2
+ type: technical
3
+ expr: "signed_power(where(close < open, volume, -volume), 2)"
4
+ direction: positive
5
+ category: flow
6
+ description: "资金净流入"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_005 均线偏离趋势因子
2
+ type: technical
3
+ expr: "ts_rank(close - ts_ave(close, 5), 5) - ts_rank(ts_decayexp(-close, 10), 20)"
4
+ direction: positive
5
+ category: trend
6
+ description: "趋势向上"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_006 收盘价位置因子
2
+ type: technical
3
+ expr: "where(close == ts_min(close, 5), close, ts_rank(close, 5))"
4
+ direction: positive
5
+ category: momentum
6
+ description: "收盘在高位"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_007 量价稳定性因子
2
+ type: technical
3
+ expr: "where(ts_rank(volume / ts_max(volume, 5), 5) < ts_rank(close / ts_max(close, 10), 10), -1, 1)"
4
+ direction: positive
5
+ category: volatility
6
+ description: "量价配合"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_008 资金净流入因子
2
+ type: technical
3
+ expr: "where(close < open, volume, -volume)"
4
+ direction: positive
5
+ category: flow
6
+ description: "资金流入"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_009 12月动量因子
2
+ type: technical
3
+ expr: "ts_sum(close, 240) / ts_sum(ts_ave(close, 20), 12) - 1"
4
+ direction: positive
5
+ category: momentum
6
+ description: "长期动量"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_010 均价偏离因子
2
+ type: technical
3
+ expr: "close - ts_ave(close, 20)"
4
+ direction: positive
5
+ category: reversal
6
+ description: "偏离均线修复"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_011 波动率收缩因子
2
+ type: technical
3
+ expr: "ts_rank(close, 10) / ts_rank(close + ts_std(close, 10), 50)"
4
+ direction: positive
5
+ category: volatility
6
+ description: "低波动率时买入"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_012 成交量反转因子
2
+ type: technical
3
+ expr: "where(ts_rank(volume, 10) < ts_rank(close + ts_std(close, 5), 100), -1, 1)"
4
+ direction: positive
5
+ category: reversal
6
+ description: "量价背离"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_013 动量加速因子
2
+ type: technical
3
+ expr: "ts_rank(close - delay(close, 5), 20) - ts_rank(close - delay(close, 10), 40)"
4
+ direction: positive
5
+ category: momentum
6
+ description: "动量加速"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_014 价格位置因子
2
+ type: technical
3
+ expr: "ts_rank(close / ts_max(close, 20), 5)"
4
+ direction: positive
5
+ category: trend
6
+ description: "接近周期高点"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_015 成交量趋势因子
2
+ type: technical
3
+ expr: "ts_rank(volume / ts_ave(volume, 20), 10) - ts_rank(close / ts_ave(close, 20), 10)"
4
+ direction: positive
5
+ category: volume
6
+ description: "放量上涨"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_016 波动率动量因子
2
+ type: technical
3
+ expr: "ts_rank(ts_std(close, 5), 20) - ts_rank(ts_std(close, 20), 20)"
4
+ direction: negative
5
+ category: volatility
6
+ description: "低波动率动量"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_017 价格宽度因子
2
+ type: technical
3
+ expr: "ts_rank(close / ts_ave(close, 50), 10) * ts_rank(volume / ts_ave(volume, 50), 5)"
4
+ direction: positive
5
+ category: trend
6
+ description: "价格强度与成交量"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_018 短期反转因子
2
+ type: technical
3
+ expr: "ts_rank(delay(close, 5), 50) - ts_rank(close, 50)"
4
+ direction: positive
5
+ category: reversal
6
+ description: "短期反转"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_019 成交量动量因子
2
+ type: technical
3
+ expr: "ts_sum(volume * sign(close - delay(close, 1)), 10) / ts_sum(volume, 10)"
4
+ direction: positive
5
+ category: momentum
6
+ description: "资金净流入"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_020 均线偏离因子
2
+ type: technical
3
+ expr: "(close - ma(close, 20)) / ma(close, 20) - (close - ma(close, 5)) / ma(close, 5)"
4
+ direction: positive
5
+ category: mean_reversion
6
+ description: "短期偏离收敛"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_021 成交量加权均价因子
2
+ type: technical
3
+ expr: "ts_rank(ts_ave(close * volume, 10) / ts_ave(volume, 10), 20)"
4
+ direction: positive
5
+ category: price
6
+ description: "成交量加权价格"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_022 量价相关性因子
2
+ type: technical
3
+ expr: "ts_rank(correlation(close, volume, 10), 20) - ts_rank(correlation(close, volume, 50), 20)"
4
+ direction: positive
5
+ category: volume
6
+ description: "短期量价关系"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_023 价格加速度因子
2
+ type: technical
3
+ expr: "ts_rank(close - delay(close, 10), 20) - ts_rank(close - delay(close, 20), 20)"
4
+ direction: positive
5
+ category: momentum
6
+ description: "价格加速度"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_024 波动率突变因子
2
+ type: technical
3
+ expr: "ts_rank(ts_std(close, 5), 10) - ts_rank(ts_std(close, 20), 10)"
4
+ direction: negative
5
+ category: volatility
6
+ description: "波动率收缩"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_025 资金流向因子
2
+ type: technical
3
+ expr: "ts_sum(where(close > delay(close, 1), volume, -volume), 20) / ts_sum(volume, 20)"
4
+ direction: positive
5
+ category: flow
6
+ description: "20日资金流向"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_026 相对强弱因子
2
+ type: technical
3
+ expr: "ts_rank(close / ts_ave(close, 50), 20) - ts_rank(ts_std(close, 10), 20)"
4
+ direction: positive
5
+ category: momentum
6
+ description: "相对强弱"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_027 量能潮因子
2
+ type: technical
3
+ expr: "ts_sum(where(close > delay(close, 1), volume, -volume), 10) / ts_sum(volume, 10)"
4
+ direction: positive
5
+ category: volume
6
+ description: "10日量能潮"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_028 均线金叉因子
2
+ type: technical
3
+ expr: "where(ma(close, 10) > ma(close, 20), 1, 0) * ts_rank(volume / ts_ave(volume, 20), 5)"
4
+ direction: positive
5
+ category: trend
6
+ description: "均线金叉"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_029 价格动量因子
2
+ type: technical
3
+ expr: "ts_rank((close - delay(close, 5)) / delay(close, 5), 20)"
4
+ direction: positive
5
+ category: momentum
6
+ description: "5日价格动量"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_030 成交量比率因子
2
+ type: technical
3
+ expr: "ts_rank(volume / ts_max(volume, 20), 5)"
4
+ direction: positive
5
+ category: volume
6
+ description: "相对成交量"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_031 价格位置因子
2
+ type: technical
3
+ expr: "ts_rank(close / ts_min(close, 20), 20) - ts_rank(close / ts_max(close, 20), 20)"
4
+ direction: positive
5
+ category: price
6
+ description: "价格相对位置"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_032 趋势强度因子
2
+ type: technical
3
+ expr: "ts_rank(close - ma(close, 20), 20) / ts_rank(ts_std(close, 20), 20)"
4
+ direction: positive
5
+ category: trend
6
+ description: "趋势强度"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_033 成交量趋势因子
2
+ type: technical
3
+ expr: "ts_rank(volume - ma(volume, 20), 10)"
4
+ direction: positive
5
+ category: volume
6
+ description: "成交量趋势"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_034 价格波动率因子
2
+ type: technical
3
+ expr: "ts_rank((high - low) / ma(close, 10), 20)"
4
+ direction: negative
5
+ category: volatility
6
+ description: "低波动率"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_035 资金流入因子
2
+ type: technical
3
+ expr: "ts_rank(where(close > open, volume, 0), 10)"
4
+ direction: positive
5
+ category: flow
6
+ description: "资金流入"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_036 RSI超卖因子
2
+ type: technical
3
+ expr: "where(rsi(close, 14) < 30, 1, 0) * ts_rank(volume / ts_ave(volume, 20), 5)"
4
+ direction: positive
5
+ category: reversal
6
+ description: "RSI超卖"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_037 布林带突破因子
2
+ type: technical
3
+ expr: "where(close > ma(close, 20) + 2 * ts_std(close, 20), 1, 0)"
4
+ direction: positive
5
+ category: trend
6
+ description: "布林带上轨突破"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_038 MACD信号因子
2
+ type: technical
3
+ expr: "ts_rank(ema(close, 12) - ema(close, 26), 10)"
4
+ direction: positive
5
+ category: momentum
6
+ description: "MACD值"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_039 量价齐升因子
2
+ type: technical
3
+ expr: "ts_rank(close / delay(close, 5), 10) * ts_rank(volume / delay(volume, 5), 10)"
4
+ direction: positive
5
+ category: momentum
6
+ description: "量价齐升"
@@ -0,0 +1,6 @@
1
+ name: ALPHA_040 强势整理因子
2
+ type: technical
3
+ expr: "where(close > ma(close, 10), 1, 0) * where(ts_std(close, 5) < ts_std(close, 20), 1, 0)"
4
+ direction: positive
5
+ category: trend
6
+ description: "强势整理"
@@ -76,6 +76,7 @@ def set_project_root(path: Union[str, Path]):
76
76
  # 目录快捷方式
77
77
  # =============================================================================
78
78
 
79
+
79
80
  def data_dir(sub: str = "") -> Path:
80
81
  """数据目录
81
82
 
@@ -115,26 +116,20 @@ def factors_dir() -> Path:
115
116
  def builtin_factors_dir() -> Path:
116
117
  """内置因子目录 (quantcli/factors/)
117
118
 
118
- 兼容可编辑安装模式。
119
- 对于可编辑安装,包在 project_root/quantcli/ 目录下。
120
- 对于标准安装,包在 site-packages/quantcli/ 目录下。
119
+ 标准安装: quantcli 在 site-packages 目录下。
120
+ 返回 quantcli/factors/alpha101/ 作为内置因子目录。
121
121
 
122
122
  Returns:
123
- 内置因子目录 Path
123
+ 内置因子目录 Path (quantcli/factors/)
124
124
  """
125
- root = project_root()
126
- cli_path = root / "quantcli"
125
+ import importlib.util
127
126
 
128
- # 可编辑安装: quantcli 是项目子目录
129
- if cli_path.exists():
130
- return cli_path / "factors"
127
+ spec = importlib.util.find_spec("quantcli")
128
+ if spec is None or spec.submodule_search_locations is None:
129
+ raise RuntimeError("quantcli package location not found")
131
130
 
132
- # 标准安装: quantcli 在 site-packages
133
- import quantcli
134
- try:
135
- return Path(quantcli.__file__).parent / "factors"
136
- except (TypeError, AttributeError):
137
- return root / "factors"
131
+ # 取第一个搜索位置
132
+ return Path(spec.submodule_search_locations[0]) / "factors"
138
133
 
139
134
 
140
135
  def strategies_dir() -> Path:
@@ -171,6 +166,7 @@ def tests_dir() -> Path:
171
166
  # 目录操作
172
167
  # =============================================================================
173
168
 
169
+
174
170
  def ensure_dir(path: Union[str, Path]) -> Path:
175
171
  """确保目录存在
176
172
 
@@ -250,12 +246,14 @@ def copy_dir(src: Union[str, Path], dst: Union[str, Path]):
250
246
  copy_dir(item, src_path)
251
247
  else:
252
248
  import shutil
249
+
253
250
  shutil.copy2(item, src_path)
254
251
 
255
252
 
256
253
  def move_dir(src: Union[str, Path], dst: Union[str, Path]):
257
254
  """移动目录"""
258
255
  import shutil
256
+
259
257
  shutil.move(str(src), str(dst))
260
258
 
261
259
 
@@ -263,10 +261,9 @@ def move_dir(src: Union[str, Path], dst: Union[str, Path]):
263
261
  # 文件操作
264
262
  # =============================================================================
265
263
 
264
+
266
265
  def find_files(
267
- pattern: str,
268
- root: Optional[Path] = None,
269
- recursive: bool = True
266
+ pattern: str, root: Optional[Path] = None, recursive: bool = True
270
267
  ) -> List[Path]:
271
268
  """查找文件
272
269
 
@@ -319,6 +316,7 @@ def file_age(path: Union[str, Path]) -> float:
319
316
  文件创建时间距今的秒数
320
317
  """
321
318
  import time
319
+
322
320
  path = Path(path)
323
321
  if not path.exists():
324
322
  return float("inf")
@@ -350,6 +348,7 @@ def format_size(size: int) -> str:
350
348
  # 路径工具
351
349
  # =============================================================================
352
350
 
351
+
353
352
  def normpath(path: Union[str, Path]) -> Path:
354
353
  """规范化路径"""
355
354
  return Path(os.path.normpath(path))
@@ -393,6 +392,7 @@ def is_subpath(path: Union[str, Path], parent: Union[str, Path]) -> bool:
393
392
  # 扩展名处理
394
393
  # =============================================================================
395
394
 
395
+
396
396
  def get_extension(path: Union[str, Path]) -> str:
397
397
  """获取文件扩展名 (含点)"""
398
398
  return Path(path).suffix
@@ -415,6 +415,7 @@ def replace_extension(path: Union[str, Path], new_ext: str) -> Path:
415
415
  # 临时文件
416
416
  # =============================================================================
417
417
 
418
+
418
419
  def temp_dir(sub: str = "") -> Path:
419
420
  """获取临时目录
420
421
 
@@ -425,6 +426,7 @@ def temp_dir(sub: str = "") -> Path:
425
426
  临时目录路径
426
427
  """
427
428
  import tempfile
429
+
428
430
  base = tempfile.gettempdir()
429
431
  path = Path(base) / "quantcli"
430
432
  if sub:
@@ -442,6 +444,7 @@ def temp_file(suffix: str = "") -> Path:
442
444
  临时文件路径
443
445
  """
444
446
  import tempfile
447
+
445
448
  fd, path = tempfile.mkstemp(suffix=suffix)
446
449
  os.close(fd)
447
450
  return Path(path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantcli
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Summary: 面向AI的多因子量化选股策略挖掘工具,AI Agent 友好 CLI
5
5
  Author-email: QuantCLI Team <quantcli@example.com>
6
6
  Project-URL: repository, https://github.com/wumu2013/quantcli
@@ -35,6 +35,46 @@ quantcli/factors/ranking.py
35
35
  quantcli/factors/ranking_executor.py
36
36
  quantcli/factors/screening.py
37
37
  quantcli/factors/screening_executor.py
38
+ quantcli/factors/alpha101/alpha_001.yaml
39
+ quantcli/factors/alpha101/alpha_002.yaml
40
+ quantcli/factors/alpha101/alpha_003.yaml
41
+ quantcli/factors/alpha101/alpha_004.yaml
42
+ quantcli/factors/alpha101/alpha_005.yaml
43
+ quantcli/factors/alpha101/alpha_006.yaml
44
+ quantcli/factors/alpha101/alpha_007.yaml
45
+ quantcli/factors/alpha101/alpha_008.yaml
46
+ quantcli/factors/alpha101/alpha_009.yaml
47
+ quantcli/factors/alpha101/alpha_010.yaml
48
+ quantcli/factors/alpha101/alpha_011.yaml
49
+ quantcli/factors/alpha101/alpha_012.yaml
50
+ quantcli/factors/alpha101/alpha_013.yaml
51
+ quantcli/factors/alpha101/alpha_014.yaml
52
+ quantcli/factors/alpha101/alpha_015.yaml
53
+ quantcli/factors/alpha101/alpha_016.yaml
54
+ quantcli/factors/alpha101/alpha_017.yaml
55
+ quantcli/factors/alpha101/alpha_018.yaml
56
+ quantcli/factors/alpha101/alpha_019.yaml
57
+ quantcli/factors/alpha101/alpha_020.yaml
58
+ quantcli/factors/alpha101/alpha_021.yaml
59
+ quantcli/factors/alpha101/alpha_022.yaml
60
+ quantcli/factors/alpha101/alpha_023.yaml
61
+ quantcli/factors/alpha101/alpha_024.yaml
62
+ quantcli/factors/alpha101/alpha_025.yaml
63
+ quantcli/factors/alpha101/alpha_026.yaml
64
+ quantcli/factors/alpha101/alpha_027.yaml
65
+ quantcli/factors/alpha101/alpha_028.yaml
66
+ quantcli/factors/alpha101/alpha_029.yaml
67
+ quantcli/factors/alpha101/alpha_030.yaml
68
+ quantcli/factors/alpha101/alpha_031.yaml
69
+ quantcli/factors/alpha101/alpha_032.yaml
70
+ quantcli/factors/alpha101/alpha_033.yaml
71
+ quantcli/factors/alpha101/alpha_034.yaml
72
+ quantcli/factors/alpha101/alpha_035.yaml
73
+ quantcli/factors/alpha101/alpha_036.yaml
74
+ quantcli/factors/alpha101/alpha_037.yaml
75
+ quantcli/factors/alpha101/alpha_038.yaml
76
+ quantcli/factors/alpha101/alpha_039.yaml
77
+ quantcli/factors/alpha101/alpha_040.yaml
38
78
  quantcli/models/bar.py
39
79
  quantcli/parser/__init__.py
40
80
  quantcli/parser/constants.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes