__version__ = '0.7.4'
__author__ = 'Jimmy Liu'
""" for trading data """
from tushare.stock.trading import (get_hist_data, get_tick_data, get_today_all, get_realtime_quotes, get_h_data, get_today_ticks, get_index, get_hists, get_k_data, get_sina_dd) """ for trading data """
from tushare.stock.fundamental import (get_stock_basics, get_report_data, get_profit_data, get_operation_data, get_growth_data, get_debtpaying_data, get_cashflow_data, get_balance_sheet, get_profit_statement, get_cash_flow) """ for macro data """
from tushare.stock.macro import (get_gdp_year, get_gdp_quarter, get_gdp_for, get_gdp_pull, get_gdp_contrib, get_cpi, get_ppi, get_deposit_rate, get_loan_rate, get_rrr, get_money_supply, get_money_supply_bal, get_gold_and_foreign_reserves) """ for classifying data """
from tushare.stock.classifying import (get_industry_classified, get_concept_classified, get_area_classified, get_gem_classified, get_sme_classified, get_st_classified, get_hs300s, get_sz50s, get_zz500s, get_terminated, get_suspended) """ for macro data """
from tushare.stock.newsevent import (get_latest_news, latest_content, get_notices, notice_content, guba_sina) """ for reference """
from tushare.stock.reference import (profit_data, forecast_data, xsg_data, fund_holdings, new_stocks, sh_margins, sh_margin_details, sz_margins, sz_margin_details, top10_holders) """ for shibor """
from tushare.stock.shibor import (shibor_data, shibor_quote_data, shibor_ma_data, lpr_data, lpr_ma_data) """ for LHB """
from tushare.stock.billboard import (top_list, cap_tops, broker_tops, inst_tops, inst_detail) """ for utils """
from tushare.util.dateu import (trade_cal, is_holiday) """ for DataYes Token """
from tushare.util.upass import (set_token, get_token, get_broker, set_broker, remove_broker) from tushare.datayes.api import *
from tushare.internet.boxoffice import (realtime_boxoffice, day_boxoffice, day_cinema, month_boxoffice) """ for fund data """
from tushare.fund.nav import (get_nav_open, get_nav_close, get_nav_grading, get_nav_history, get_fund_info) """ for trader API """
from tushare.trader.trader import TraderAPI """ for futures API """
from tushare.futures.intlfutures import (get_intlfuture) from tushare.stock.globals import (global_realtime) from tushare.util.mailmerge import (MailMerge)
ts.get_hist_data('600848') #一次性獲取所有日k線數據
ts.get_hist_data('600848', ktype='W') #獲取周k線數據 ts.get_hist_data('600848', ktype='M') #獲取月k線數據 ts.get_hist_data('600848', ktype='5') #獲取5分鐘k線數據 ts.get_hist_data('600848', ktype='15') #獲取15分鐘k線數據 ts.get_hist_data('600848', ktype='30') #獲取30分鐘k線數據 ts.get_hist_data('600848', ktype='60') #獲取60分鐘k線數據 ts.get_hist_data('sh')#獲取上證指數k線數據,其它參數與個股一致,下同 ts.get_hist_data('sz')#獲取深圳成指k線數據 ts.get_hist_data('hs300')#獲取滬深300指數k線數據 ts.get_hist_data('sz50')#獲取上證50指數k線數據 ts.get_hist_data('zxb')#獲取中小板指數k線數據 ts.get_hist_data('cyb')#獲取創業板指數k線數據
df = ts.get_stock_basics() date = df.ix['600848']['timeToMarket'] #上市日期YYYYMMDD
ts.get_h_data('002337') #前復權 ts.get_h_data('002337', autype='hfq') #後復權 ts.get_h_data('002337', autype=None) #不復權 ts.get_h_data('002337', start='2015-01-01', end='2015-03-16') #兩個日期之間的前復權數據 ts.get_h_data('399106', index=True) #深圳綜合指數
ts.get_today_all()
df = ts.get_tick_data('600848',date='2014-01-09') df.head(10)
df = ts.get_realtime_quotes('000581') #Single stock symbol df[['code','name','price','bid','ask','volume','amount','time']]
#symbols from a list
ts.get_realtime_quotes(['600848','000980','000981']) #from a Series ts.get_realtime_quotes(df['code'].tail(10)) #一次獲取10個股票的實時分筆數據
#上證指數
ts.get_realtime_quotes('sh') #上證指數 深圳成指 滬深300指數 上證50 中小板 創業板 ts.get_realtime_quotes(['sh','sz','hs300','sz50','zxb','cyb']) #或者混搭 ts.get_realtime_quotes(['sh','600848'])
df = ts.get_today_ticks('601333') df.head(10)
df = ts.get_index()
df = ts.get_sina_dd('600848', date='2015-12-24') #默認400手 #df = ts.get_sina_dd('600848', date='2015-12-24', vol=500) #指定大於等於500手的數據
行業分類 ts.get_industry_classified()
概念分類 ts.get_concept_classified()
地域分類 ts.get_area_classified()
中小板分類 ts.get_sme_classified()
創業板分類 ts.get_gem_classified()
風險警示板分類 ts.get_st_classified()
滬深300成份股及權重 ts.get_hs300s()
上證50成份股 ts.get_sz50s()
中證500成份股 ts.get_zz500s()
終止上市股票列表 ts.get_terminated()
暫停上市股票列表 ts.get_suspended()api