def download_economy():
import tushare as ts
path = './data/'
ts.get_money_supply().to_csv(path+'money_supply.csv')
ts.get_gdp_quarter().to_csv(path+'gdp_quarter.csv')
ts.get_gdp_year().to_csv(path + 'gdp_year.csv')
ts.get_cpi().to_csv(path+'cpi.csv')
# ts.get_hist_data('sz').to_csv(path + 'sz.csv')
# ts.get_hist_data('sh').to_csv(path + 'sh.csv')
# import time
import datetime
# now_year = time.localtime().tm_year
# now_mon = time.localtime().tm_mon
# now_day = time.localtime().tm_mday
years = 3
start = datetime.datetime.today().date() + datetime.timedelta(-365*years)
end = datetime.datetime.today().date()
ts.get_k_data('399001', start=str(start), index=True).to_csv(path + 'sz.csv') #??2? ,
ts.get_k_data('000001', start=str(start), index=True).to_csv(path + 'sh.csv')
#??????
ts.get_rrr().to_csv(path + 'rrr.csv')
评论列表
文章目录