Files
ProStock/tests/test_tushare_api.py
liaozhaorun 05228ce9de refactor: 调整项目结构,新增数据同步和交易日历模块
- 移除 pyproject.toml,改用 uv 管理项目
- 新增 data/* 忽略规则
- 新增数据同步模块 sync.py
- 新增交易日历模块 trade_cal.py
- 新增相关测试用例
- 更新 API 文档
2026-02-01 04:44:01 +08:00

21 lines
512 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""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)