三方独享 token,用法和数据与 tushare 一致。
pip install tinyshare --upgradeimport tushare as ts 改为:import tinyshare as ts只需修改一句代码即可使用。
# 使用 tinyshare
import tinyshare as ts
# 设置 token
ts.set_token('授权码')
pro = ts.pro_api()
# 获取指数日线行情
df = pro.index_daily(
ts_code='000001.SH',
start_date='20260204',
end_date='20260211'
)
print(df)