refactor: 调整项目结构,新增数据同步和交易日历模块
- 移除 pyproject.toml,改用 uv 管理项目 - 新增 data/* 忽略规则 - 新增数据同步模块 sync.py - 新增交易日历模块 trade_cal.py - 新增相关测试用例 - 更新 API 文档
This commit is contained in:
20
tests/test_tushare_api.py
Normal file
20
tests/test_tushare_api.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Tushare API 验证脚本 - 快速生成 pro 对象用于调试。"""
|
||||
|
||||
import os
|
||||
|
||||
os.environ.setdefault("DATA_PATH", "data")
|
||||
|
||||
from src.data.config import get_config
|
||||
import tushare as ts
|
||||
|
||||
config = get_config()
|
||||
token = config.tushare_token
|
||||
|
||||
if not token:
|
||||
raise ValueError("请在 config/.env.local 中配置 TUSHARE_TOKEN")
|
||||
|
||||
pro = ts.pro_api(token)
|
||||
print(f"pro_api 对象已创建,token: {token[:10]}...")
|
||||
|
||||
df = pro.query('daily', ts_code='000001.SZ', start_date='20180702', end_date='20180718')
|
||||
print(df)
|
||||
Reference in New Issue
Block a user