43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
启动A股日线数据全量下载
|
|
"""
|
|
import sys
|
|
import os
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
from a_stock_daily_data_downloader import AStockDailyDownloader
|
|
|
|
print("="*70)
|
|
print("🚀 赵云启动A股日线数据全量下载")
|
|
print("="*70)
|
|
|
|
# 创建下载器
|
|
downloader = AStockDailyDownloader(
|
|
base_dir="/Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live/zhaoyun-data/data/raw/daily",
|
|
start_date="2010-01-01",
|
|
end_date=None, # 到今天
|
|
retry_count=3,
|
|
request_delay=0.3
|
|
)
|
|
|
|
# 开始全量下载
|
|
result = downloader.download_all_stocks(
|
|
skip_downloaded=True,
|
|
batch_size=10
|
|
)
|
|
|
|
# 保存结果
|
|
result_file = "/Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live/zhaoyun-data/data/raw/running_data/daily_download_stats.json"
|
|
with open(result_file, 'w', encoding='utf-8') as f:
|
|
import json
|
|
json.dump(result, f, ensure_ascii=False, indent=2)
|
|
|
|
print("\n" + "="*70)
|
|
print("📊 日线数据全量下载完成")
|
|
print(f" 总股票数: {result['total_stocks']}")
|
|
print(f" 下载成功: {result['downloaded_stocks']}")
|
|
print(f" 下载失败: {result['failed_stocks']}")
|
|
print(f" 结果已保存: {result_file}")
|
|
print("="*70)
|