构建期货数据采集与三层打分系统

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-05-02 22:56:10 +08:00
parent e55aa8603b
commit c466dbbf3f
12 changed files with 681 additions and 0 deletions

23
tushare/main.py Normal file
View File

@@ -0,0 +1,23 @@
import os
import sys
import tushare as ts
def main() -> int:
token = os.environ.get("TUSHARE_TOKEN")
if not token:
print("[ERROR] 未设置 TUSHARE_TOKEN 环境变量", file=sys.stderr)
return 1
ts.set_token(token)
pro = ts.pro_api()
df = pro.trade_cal(exchange="SHFE", start_date="20260101", end_date="20260110")
print(f"[OK] tushare 连通,返回 {len(df)} 行交易日历样本")
print(df.head())
return 0
if __name__ == "__main__":
sys.exit(main())