20 lines
427 B
Python
20 lines
427 B
Python
import sys
|
|
|
|
import tushare as ts
|
|
|
|
TUSHARE_TOKEN = "76efd8465f9f2591aa42a385268e06acf6b80b7a15be2267ad2281b7"
|
|
|
|
|
|
def main() -> int:
|
|
ts.set_token(TUSHARE_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())
|