将 TUSHARE_TOKEN 写死到代码中,移除 .env 引用
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
import pandas as pd
|
||||
import tushare as ts
|
||||
|
||||
TUSHARE_TOKEN = "76efd8465f9f2591aa42a385268e06acf6b80b7a15be2267ad2281b7"
|
||||
|
||||
|
||||
def _init_api():
|
||||
token = os.environ.get("TUSHARE_TOKEN")
|
||||
if not token:
|
||||
raise RuntimeError("TUSHARE_TOKEN 环境变量未设置")
|
||||
ts.set_token(token)
|
||||
ts.set_token(TUSHARE_TOKEN)
|
||||
return ts.pro_api()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user