示例#1
0
class Tushare2MySQLTest(unittest.TestCase):
    def setUp(self) -> None:
        set_global_config('config.json')
        self.downloader = TushareData()

    def test_calendar(self):
        print(self.downloader.calendar.calendar)

    def test_financial(self):
        self.downloader.get_financial(['300146.SZ', '000001.SZ'])

    def test_index(self):
        self.downloader.get_index_daily()

    def test_ipo_info(self):
        self.downloader.get_ipo_info()

    def test_all_past_names(self):
        self.downloader.init_stock_names()

    def test_past_names(self):
        self.downloader.update_stock_names()

    def test_company_info(self):
        self.downloader.get_company_info()

    def test_daily_hq(self):
        self.downloader.get_daily_hq(start_date='2010917')

    def test_all_dividend(self):
        self.downloader.get_all_dividend()

    def test_routine(self):
        # self.downloader.update_routine()
        pass

    def test_hs_const(self):
        self.downloader.get_hs_constitute()

    def test_shibor(self):
        self.downloader.get_shibor(end_date='20111010')

    def test_index_weight(self):
        self.downloader.get_index_weight(start_date='20050101')
示例#2
0
import sys

from AShareData import ConstLimitStockFactorCompositor, JQData, set_global_config, TushareData, WindData

if __name__ == '__main__':
    set_global_config(sys.argv[1])

    tushare_crawler = TushareData()
    tushare_crawler.update_base_info()
    tushare_crawler.get_shibor()

    tushare_crawler.get_ipo_info()
    tushare_crawler.get_company_info()
    tushare_crawler.update_hs_holding()
    tushare_crawler.get_hs_constitute()

    tushare_crawler.update_stock_names()
    tushare_crawler.update_dividend()

    tushare_crawler.update_index_daily()

    tushare_crawler.update_hk_stock_daily()

    tushare_crawler.update_fund_daily()
    tushare_crawler.update_fund_dividend()

    with WindData() as wind_data:
        wind_data.update_stock_daily_data()
        wind_data.update_stock_adj_factor()
        wind_data.update_stock_units()
        wind_data.update_industry()