aishare-txt 2025.11.24.20__tar.gz → 2025.11.24.26__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.
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/__init__.py +1 -1
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/core/analyzer.py +57 -16
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/core/data_fetcher.py +17 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/core/report_generator.py +68 -6
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/indicators/technical_indicators.py +43 -19
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/utils/utils.py +21 -4
- {aishare_txt-2025.11.24.20/aishare_txt.egg-info → aishare_txt-2025.11.24.26}/PKG-INFO +2 -1
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26/aishare_txt.egg-info}/PKG-INFO +2 -1
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/aishare_txt.egg-info/requires.txt +1 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/requirements.txt +1 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/setup.py +1 -1
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/ai/__init__.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/ai/client.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/ai/providers/__init__.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/core/__init__.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/core/config.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/docs/AI_INTEGRATION.md +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/docs/README_/351/207/215/346/236/204/350/257/264/346/230/216.md" +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/docs//351/207/215/346/236/204/345/256/214/346/210/220/346/200/273/347/273/223.md" +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/examples/legacy_api.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/indicators/__init__.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/tests/__init__.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/utils/__init__.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/AIShareTxt/utils/stock_list.py +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/LICENSE +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/MANIFEST.in +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/README.md +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/aishare_txt.egg-info/SOURCES.txt +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/aishare_txt.egg-info/dependency_links.txt +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/aishare_txt.egg-info/entry_points.txt +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/aishare_txt.egg-info/not-zip-safe +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/aishare_txt.egg-info/top_level.txt +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/requirements-dev.txt +0 -0
- {aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/setup.cfg +0 -0
|
@@ -9,7 +9,7 @@ import warnings
|
|
|
9
9
|
from .data_fetcher import StockDataFetcher
|
|
10
10
|
from ..indicators.technical_indicators import TechnicalIndicators
|
|
11
11
|
from .report_generator import ReportGenerator
|
|
12
|
-
from ..utils.utils import Logger, LoggerManager, Utils, DataValidator, ErrorHandler
|
|
12
|
+
from ..utils.utils import Logger, LoggerManager, Utils, DataValidator, ErrorHandler, PerformanceMonitor
|
|
13
13
|
from .config import IndicatorConfig as Config
|
|
14
14
|
|
|
15
15
|
warnings.filterwarnings('ignore')
|
|
@@ -120,9 +120,10 @@ class StockAnalyzer:
|
|
|
120
120
|
# 生成报告
|
|
121
121
|
self.logger.info("生成分析报告...")
|
|
122
122
|
report = self.report_generator.generate_report(
|
|
123
|
-
stock_code,
|
|
124
|
-
self.indicators,
|
|
125
|
-
self.stock_info
|
|
123
|
+
stock_code,
|
|
124
|
+
self.indicators,
|
|
125
|
+
self.stock_info,
|
|
126
|
+
self.stock_data
|
|
126
127
|
)
|
|
127
128
|
|
|
128
129
|
if monitor:
|
|
@@ -172,9 +173,10 @@ class StockAnalyzer:
|
|
|
172
173
|
|
|
173
174
|
# 生成报告(不包含基本信息和资金流)
|
|
174
175
|
report = self.report_generator.generate_report(
|
|
175
|
-
stock_code,
|
|
176
|
-
self.indicators,
|
|
177
|
-
None # 不包含基本信息
|
|
176
|
+
stock_code,
|
|
177
|
+
self.indicators,
|
|
178
|
+
None, # 不包含基本信息
|
|
179
|
+
self.stock_data
|
|
178
180
|
)
|
|
179
181
|
|
|
180
182
|
return report
|
|
@@ -382,6 +384,15 @@ def quick_test(stock_code):
|
|
|
382
384
|
|
|
383
385
|
# 执行分析
|
|
384
386
|
report = analyzer.analyze_stock(stock_code, enable_performance_monitor=True)
|
|
387
|
+
|
|
388
|
+
# 检查分析结果是否为错误信息
|
|
389
|
+
if report and (report.startswith("错误:") or report.startswith("数据质量验证失败") or
|
|
390
|
+
report.startswith("指标验证失败") or report.startswith("分析过程中出错") or
|
|
391
|
+
"无数据" in report or "计算失败" in report):
|
|
392
|
+
print("\n" + report)
|
|
393
|
+
logger.error(f"快速测试股票 {stock_code} 失败: {report}")
|
|
394
|
+
return False
|
|
395
|
+
|
|
385
396
|
print("\n" + report)
|
|
386
397
|
|
|
387
398
|
# 显示分析摘要
|
|
@@ -403,8 +414,45 @@ def quick_test(stock_code):
|
|
|
403
414
|
|
|
404
415
|
def main():
|
|
405
416
|
"""主函数"""
|
|
406
|
-
analyzer = StockAnalyzer()
|
|
407
417
|
utils = Utils()
|
|
418
|
+
|
|
419
|
+
# 首先检查命令行参数(包括帮助参数)
|
|
420
|
+
stock_code = utils.parse_command_line_args()
|
|
421
|
+
if stock_code:
|
|
422
|
+
# 如果提供了股票代码,则初始化分析器并进行快速测试
|
|
423
|
+
analyzer = StockAnalyzer()
|
|
424
|
+
logger = LoggerManager.get_logger('stock_analyzer')
|
|
425
|
+
|
|
426
|
+
print("股票技术指标分析器 (重构版)")
|
|
427
|
+
print(utils.create_separator())
|
|
428
|
+
print("提示:可以在命令行直接运行 python stock_analyzer.py 000001 来快速测试")
|
|
429
|
+
logger.info("股票技术指标分析器启动")
|
|
430
|
+
|
|
431
|
+
# 验证分析环境
|
|
432
|
+
print("\n验证分析环境...")
|
|
433
|
+
logger.info("开始验证分析环境")
|
|
434
|
+
is_valid, errors = analyzer.validate_analysis_environment()
|
|
435
|
+
if not is_valid:
|
|
436
|
+
print("环境验证失败:")
|
|
437
|
+
logger.error("环境验证失败")
|
|
438
|
+
for error in errors:
|
|
439
|
+
print(f" [错误] {error}")
|
|
440
|
+
logger.error(f"环境错误: {error}")
|
|
441
|
+
return
|
|
442
|
+
else:
|
|
443
|
+
print("环境验证通过")
|
|
444
|
+
logger.info("环境验证通过")
|
|
445
|
+
|
|
446
|
+
logger.info(f"使用命令行参数启动快速测试: {stock_code}")
|
|
447
|
+
result = quick_test(stock_code)
|
|
448
|
+
if result:
|
|
449
|
+
print("\n分析完成!")
|
|
450
|
+
else:
|
|
451
|
+
print("\n分析失败,请检查日志获取详细信息。")
|
|
452
|
+
return
|
|
453
|
+
|
|
454
|
+
# 如果没有提供命令行参数,则进入交互模式
|
|
455
|
+
analyzer = StockAnalyzer()
|
|
408
456
|
logger = LoggerManager.get_logger('stock_analyzer')
|
|
409
457
|
|
|
410
458
|
print("股票技术指标分析器 (重构版)")
|
|
@@ -424,16 +472,9 @@ def main():
|
|
|
424
472
|
logger.error(f"环境错误: {error}")
|
|
425
473
|
return
|
|
426
474
|
else:
|
|
427
|
-
print("
|
|
475
|
+
print("环境验证通过")
|
|
428
476
|
logger.info("环境验证通过")
|
|
429
477
|
|
|
430
|
-
# 检查命令行参数
|
|
431
|
-
stock_code = utils.parse_command_line_args()
|
|
432
|
-
if stock_code:
|
|
433
|
-
logger.info(f"使用命令行参数启动快速测试: {stock_code}")
|
|
434
|
-
quick_test(stock_code)
|
|
435
|
-
return
|
|
436
|
-
|
|
437
478
|
# 交互模式
|
|
438
479
|
while True:
|
|
439
480
|
try:
|
|
@@ -262,6 +262,11 @@ class StockDataFetcher:
|
|
|
262
262
|
start_date=start_date,
|
|
263
263
|
adjust=cast(str, adjust)
|
|
264
264
|
)
|
|
265
|
+
|
|
266
|
+
# 对成交量列需要进行数量转换*100,从手转换为股
|
|
267
|
+
if '成交量' in raw_data.columns:
|
|
268
|
+
raw_data['成交量'] *= 100
|
|
269
|
+
|
|
265
270
|
return cast(pd.DataFrame, raw_data)
|
|
266
271
|
except Exception as e:
|
|
267
272
|
self.logger.warning(f"[方法1] 东方财富API获取失败:{str(e)}")
|
|
@@ -290,6 +295,11 @@ class StockDataFetcher:
|
|
|
290
295
|
end_date=end_date,
|
|
291
296
|
adjust=adjust
|
|
292
297
|
)
|
|
298
|
+
|
|
299
|
+
# amount列更名为turnover
|
|
300
|
+
if 'amount' in raw_data.columns:
|
|
301
|
+
raw_data.rename(columns={'amount': 'turnover'}, inplace=True)
|
|
302
|
+
|
|
293
303
|
return cast(pd.DataFrame, raw_data)
|
|
294
304
|
except Exception as e:
|
|
295
305
|
self.logger.warning(f"[方法2] 新浪API获取失败:{str(e)}")
|
|
@@ -318,6 +328,13 @@ class StockDataFetcher:
|
|
|
318
328
|
end_date=end_date,
|
|
319
329
|
adjust=adjust
|
|
320
330
|
)
|
|
331
|
+
|
|
332
|
+
# 对成交量列需要进行数量转换*100,从手转换为股,并且列名从amount改为volume
|
|
333
|
+
if 'amount' in raw_data.columns:
|
|
334
|
+
raw_data['volume'] = raw_data['amount'] * 100
|
|
335
|
+
# 移除原始amount列
|
|
336
|
+
raw_data.drop(columns=['amount'], inplace=True)
|
|
337
|
+
|
|
321
338
|
return cast(pd.DataFrame, raw_data)
|
|
322
339
|
except Exception as e:
|
|
323
340
|
self.logger.warning(f"[方法3] 腾讯API获取失败:{str(e)}")
|
|
@@ -14,15 +14,16 @@ class ReportGenerator:
|
|
|
14
14
|
def __init__(self):
|
|
15
15
|
self.config = Config()
|
|
16
16
|
|
|
17
|
-
def generate_report(self, stock_code, indicators, stock_info=None):
|
|
17
|
+
def generate_report(self, stock_code, indicators, stock_info=None, stock_data=None):
|
|
18
18
|
"""
|
|
19
19
|
生成完整的股票分析报告
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
Args:
|
|
22
22
|
stock_code (str): 股票代码
|
|
23
23
|
indicators (dict): 指标数据字典
|
|
24
24
|
stock_info (dict): 股票基本信息
|
|
25
|
-
|
|
25
|
+
stock_data (pd.DataFrame): 股票历史数据
|
|
26
|
+
|
|
26
27
|
Returns:
|
|
27
28
|
str: 格式化的报告文本
|
|
28
29
|
"""
|
|
@@ -47,7 +48,11 @@ class ReportGenerator:
|
|
|
47
48
|
report.extend(self._generate_fund_flow_section(indicators))
|
|
48
49
|
report.extend(self._generate_trend_strength_section(indicators))
|
|
49
50
|
report.extend(self._generate_summary_section(indicators))
|
|
50
|
-
|
|
51
|
+
|
|
52
|
+
# 最近5天OLHCV数据
|
|
53
|
+
if stock_data is not None:
|
|
54
|
+
report.extend(self._generate_recent_ohlcv_section(stock_data))
|
|
55
|
+
|
|
51
56
|
# 报告尾部
|
|
52
57
|
report.extend(self._generate_footer())
|
|
53
58
|
|
|
@@ -280,7 +285,7 @@ class ReportGenerator:
|
|
|
280
285
|
summary = self._collect_summary_items(indicators)
|
|
281
286
|
|
|
282
287
|
for item in summary:
|
|
283
|
-
section.append(f"
|
|
288
|
+
section.append(f"- {item}")
|
|
284
289
|
|
|
285
290
|
return section
|
|
286
291
|
|
|
@@ -779,5 +784,62 @@ class ReportGenerator:
|
|
|
779
784
|
summary.append(f"超大单:净流入{super_amount_wan:.{self.config.DISPLAY_PRECISION['volume_wan']}f}万元({super_ratio:+.1f}%)")
|
|
780
785
|
else:
|
|
781
786
|
summary.append(f"超大单:净流出{abs(super_amount_wan):.{self.config.DISPLAY_PRECISION['volume_wan']}f}万元({super_ratio:+.1f}%)")
|
|
782
|
-
|
|
787
|
+
|
|
783
788
|
return summary
|
|
789
|
+
|
|
790
|
+
def _generate_recent_ohlcv_section(self, stock_data):
|
|
791
|
+
"""生成最近5天OLHCV数据部分"""
|
|
792
|
+
section = []
|
|
793
|
+
section.append("\n【十、最近5天交易数据】")
|
|
794
|
+
section.append(self.config.REPORT_CONFIG['section_separator'])
|
|
795
|
+
|
|
796
|
+
# 获取最近5天数据
|
|
797
|
+
recent_data = stock_data.tail(5)
|
|
798
|
+
|
|
799
|
+
# 表头
|
|
800
|
+
section.append("日期 开盘价 最高价 最低价 收盘价 成交量(万手) 成交额(亿元)")
|
|
801
|
+
section.append("─" * 70)
|
|
802
|
+
|
|
803
|
+
# 获取索引位置,用于计算涨跌幅
|
|
804
|
+
index_positions = list(range(len(recent_data)))
|
|
805
|
+
|
|
806
|
+
for i, (idx, row) in enumerate(recent_data.iterrows()):
|
|
807
|
+
# 格式化日期 - 使用date列而不是索引
|
|
808
|
+
if 'date' in row and hasattr(row['date'], 'strftime'):
|
|
809
|
+
date_str = row['date'].strftime('%Y-%m-%d')
|
|
810
|
+
elif 'date' in row:
|
|
811
|
+
date_str = str(row['date'])[:10] if len(str(row['date'])) > 10 else str(row['date'])
|
|
812
|
+
else:
|
|
813
|
+
# 如果没有date列,尝试使用索引
|
|
814
|
+
date_str = idx.strftime('%Y-%m-%d') if hasattr(idx, 'strftime') else str(idx)[:10]
|
|
815
|
+
|
|
816
|
+
# 格式化价格数据
|
|
817
|
+
open_price = f"{row['open']:.2f}"
|
|
818
|
+
high_price = f"{row['high']:.2f}"
|
|
819
|
+
low_price = f"{row['low']:.2f}"
|
|
820
|
+
close_price = f"{row['close']:.2f}"
|
|
821
|
+
|
|
822
|
+
# 计算涨跌幅
|
|
823
|
+
if i > 0: # 不是第一行
|
|
824
|
+
prev_close = recent_data.iloc[i-1]['close']
|
|
825
|
+
change_percent = ((row['close'] - prev_close) / prev_close * 100)
|
|
826
|
+
change_sign = "▲" if change_percent > 0 else "▼" if change_percent < 0 else "─"
|
|
827
|
+
close_price = f"{row['close']:.2f}{change_sign}"
|
|
828
|
+
else:
|
|
829
|
+
close_price = f"{row['close']:.2f}"
|
|
830
|
+
|
|
831
|
+
# 格式化成交量 (转换为万手)
|
|
832
|
+
volume_wan_hands = row['volume'] / 1000000
|
|
833
|
+
volume_str = f"{volume_wan_hands:.1f}"
|
|
834
|
+
|
|
835
|
+
# 格式化成交额 (转换为亿元)
|
|
836
|
+
# 如果没有turnover字段,使用估算值
|
|
837
|
+
amount = row.get('turnover', row['close'] * row['volume'])
|
|
838
|
+
amount_yi = amount / 100000000
|
|
839
|
+
amount_str = f"{amount_yi:.2f}"
|
|
840
|
+
|
|
841
|
+
# 组合一行数据
|
|
842
|
+
line = f"{date_str} {open_price:>8} {high_price:>8} {low_price:>8} {close_price:>10} {volume_str:>10} {amount_str:>12}"
|
|
843
|
+
section.append(line)
|
|
844
|
+
|
|
845
|
+
return section
|
|
@@ -470,7 +470,6 @@ class TechnicalIndicators:
|
|
|
470
470
|
# OBV背离验证
|
|
471
471
|
if len(obv) >= 20 and len(close) >= 20:
|
|
472
472
|
try:
|
|
473
|
-
from scipy.signal import argrelextrema
|
|
474
473
|
indicators['OBV_DIVERGENCE'] = self._detect_obv_divergence(obv, close, obv_config)
|
|
475
474
|
except ImportError:
|
|
476
475
|
indicators['OBV_DIVERGENCE'] = "需要scipy库进行背离分析"
|
|
@@ -481,38 +480,63 @@ class TechnicalIndicators:
|
|
|
481
480
|
"""检测OBV背离"""
|
|
482
481
|
try:
|
|
483
482
|
from scipy.signal import argrelextrema
|
|
484
|
-
|
|
483
|
+
|
|
485
484
|
recent_close = close[-20:]
|
|
486
485
|
recent_obv = obv[-20:]
|
|
487
486
|
|
|
487
|
+
# 将pandas Series转换为numpy数组以解决兼容性问题
|
|
488
|
+
if hasattr(recent_close, 'values'):
|
|
489
|
+
recent_close = recent_close.values
|
|
490
|
+
if hasattr(recent_obv, 'values'):
|
|
491
|
+
recent_obv = recent_obv.values
|
|
492
|
+
|
|
493
|
+
# 确保有足够的数据点
|
|
494
|
+
if len(recent_close) < 10 or len(recent_obv) < 10:
|
|
495
|
+
return "数据不足"
|
|
496
|
+
|
|
488
497
|
# 找局部高点和低点
|
|
489
498
|
order = config['extrema_order']
|
|
490
499
|
price_highs = argrelextrema(recent_close, np.greater, order=order)[0]
|
|
491
500
|
price_lows = argrelextrema(recent_close, np.less, order=order)[0]
|
|
492
501
|
obv_highs = argrelextrema(recent_obv, np.greater, order=order)[0]
|
|
493
502
|
obv_lows = argrelextrema(recent_obv, np.less, order=order)[0]
|
|
494
|
-
|
|
495
|
-
#
|
|
496
|
-
if len(price_highs) >= 2
|
|
503
|
+
|
|
504
|
+
# 顶背离检测:价格创新高,但OBV未创新高
|
|
505
|
+
if len(price_highs) >= 2:
|
|
506
|
+
# 取最后两个价格高点
|
|
497
507
|
latest_price_high_idx = price_highs[-1]
|
|
498
508
|
prev_price_high_idx = price_highs[-2]
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
509
|
+
|
|
510
|
+
# 检查价格是否创新高
|
|
511
|
+
if recent_close[latest_price_high_idx] > recent_close[prev_price_high_idx]:
|
|
512
|
+
# 寻找对应时间点的OBV值进行比较
|
|
513
|
+
latest_obv_value = recent_obv[latest_price_high_idx]
|
|
514
|
+
prev_obv_value = recent_obv[prev_price_high_idx]
|
|
515
|
+
|
|
516
|
+
# 如果OBV没有创新高,则为顶背离
|
|
517
|
+
if latest_obv_value < prev_obv_value:
|
|
503
518
|
return "顶背离"
|
|
504
|
-
|
|
505
|
-
#
|
|
506
|
-
if len(price_lows) >= 2
|
|
519
|
+
|
|
520
|
+
# 底背离检测:价格创新低,但OBV未创新低
|
|
521
|
+
if len(price_lows) >= 2:
|
|
522
|
+
# 取最后两个价格低点
|
|
507
523
|
latest_price_low_idx = price_lows[-1]
|
|
508
524
|
prev_price_low_idx = price_lows[-2]
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
525
|
+
|
|
526
|
+
# 检查价格是否创新低
|
|
527
|
+
if recent_close[latest_price_low_idx] < recent_close[prev_price_low_idx]:
|
|
528
|
+
# 寻找对应时间点的OBV值进行比较
|
|
529
|
+
latest_obv_value = recent_obv[latest_price_low_idx]
|
|
530
|
+
prev_obv_value = recent_obv[prev_price_low_idx]
|
|
531
|
+
|
|
532
|
+
# 如果OBV没有创新低,则为底背离
|
|
533
|
+
if latest_obv_value > prev_obv_value:
|
|
513
534
|
return "底背离"
|
|
514
|
-
|
|
535
|
+
|
|
515
536
|
return "无明显背离"
|
|
516
|
-
|
|
517
|
-
except
|
|
537
|
+
|
|
538
|
+
except ImportError:
|
|
539
|
+
return "需要scipy库进行背离分析"
|
|
540
|
+
except Exception as e:
|
|
541
|
+
print(f"OBV背离检测错误: {e}")
|
|
518
542
|
return "背离检测失败"
|
|
@@ -272,12 +272,29 @@ class Utils:
|
|
|
272
272
|
str or None: 股票代码,如果没有提供则返回None
|
|
273
273
|
"""
|
|
274
274
|
if len(sys.argv) > 1:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
arg = sys.argv[1].strip()
|
|
276
|
+
|
|
277
|
+
# 处理帮助参数
|
|
278
|
+
if arg in ['-h', '--help', 'help']:
|
|
279
|
+
print("\n股票技术指标分析器 (重构版)")
|
|
280
|
+
print("\n使用方法:")
|
|
281
|
+
print(" aishare [股票代码] - 分析指定股票")
|
|
282
|
+
print(" aishare -h/--help - 显示帮助信息")
|
|
283
|
+
print("\n示例:")
|
|
284
|
+
print(" aishare 000001 - 分析平安银行")
|
|
285
|
+
print(" aishare 600036 - 分析招商银行")
|
|
286
|
+
print("\n交互模式:")
|
|
287
|
+
print(" 不带参数运行将进入交互模式,可以输入股票代码进行分析")
|
|
288
|
+
print(" 输入 'quit' 或 'exit' 退出程序")
|
|
289
|
+
sys.exit(0)
|
|
290
|
+
|
|
291
|
+
# 处理股票代码
|
|
292
|
+
if Utils.validate_stock_code(arg):
|
|
293
|
+
return arg
|
|
278
294
|
else:
|
|
279
|
-
print(f"错误:股票代码 '{
|
|
295
|
+
print(f"错误:股票代码 '{arg}' 格式不正确")
|
|
280
296
|
print("正确格式:6位数字,如 000001")
|
|
297
|
+
print("使用 'aishare --help' 查看更多帮助信息")
|
|
281
298
|
return None
|
|
282
299
|
return None
|
|
283
300
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aishare-txt
|
|
3
|
-
Version: 2025.11.24.
|
|
3
|
+
Version: 2025.11.24.26
|
|
4
4
|
Summary: 中国股票技术指标文本生成工具包,用于为金融分析相关领域的AI智能体提供上下文服务。
|
|
5
5
|
Home-page: https://gitee.com/chaofanat/aishare-txt
|
|
6
6
|
Author: AIShareTxt Team
|
|
@@ -23,6 +23,7 @@ Requires-Dist: pandas>=1.5.0
|
|
|
23
23
|
Requires-Dist: numpy>=1.21.0
|
|
24
24
|
Requires-Dist: requests>=2.28.0
|
|
25
25
|
Requires-Dist: pandas_market_calendars>=1.1.0
|
|
26
|
+
Requires-Dist: scipy>=1.9.0
|
|
26
27
|
Requires-Dist: openai>=1.0.0
|
|
27
28
|
Requires-Dist: zhipuai>=2.0.0
|
|
28
29
|
Provides-Extra: dev
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aishare-txt
|
|
3
|
-
Version: 2025.11.24.
|
|
3
|
+
Version: 2025.11.24.26
|
|
4
4
|
Summary: 中国股票技术指标文本生成工具包,用于为金融分析相关领域的AI智能体提供上下文服务。
|
|
5
5
|
Home-page: https://gitee.com/chaofanat/aishare-txt
|
|
6
6
|
Author: AIShareTxt Team
|
|
@@ -23,6 +23,7 @@ Requires-Dist: pandas>=1.5.0
|
|
|
23
23
|
Requires-Dist: numpy>=1.21.0
|
|
24
24
|
Requires-Dist: requests>=2.28.0
|
|
25
25
|
Requires-Dist: pandas_market_calendars>=1.1.0
|
|
26
|
+
Requires-Dist: scipy>=1.9.0
|
|
26
27
|
Requires-Dist: openai>=1.0.0
|
|
27
28
|
Requires-Dist: zhipuai>=2.0.0
|
|
28
29
|
Provides-Extra: dev
|
|
@@ -42,7 +42,7 @@ dev_requires = read_requirements("requirements-dev.txt")
|
|
|
42
42
|
|
|
43
43
|
setup(
|
|
44
44
|
name="aishare-txt",
|
|
45
|
-
version="2025.11.24.
|
|
45
|
+
version="2025.11.24.26",
|
|
46
46
|
author="AIShareTxt Team",
|
|
47
47
|
author_email="chaofanat@gmail.com",
|
|
48
48
|
description="中国股票技术指标文本生成工具包,用于为金融分析相关领域的AI智能体提供上下文服务。",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/aishare_txt.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{aishare_txt-2025.11.24.20 → aishare_txt-2025.11.24.26}/aishare_txt.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|