示例#1
0
class MyTestCase(unittest.TestCase):
    def setUp(self) -> None:
        set_global_config('config.json')
        self.jq_data = JQData()

    def test_jq_login(self):
        self.jq_data.update_convertable_bond_list()
示例#2
0
 def setUp(self) -> None:
     config_loc = 'config.json'
     with open(config_loc, 'r') as f:
         config = json.load(f)
     config_loc = 'config.json'
     engine = prepare_engine(config_loc)
     db_interface = MySQLInterface(engine)
     self.jq_data = JQData(db_interface, config['jq_mobile'], config['jq_password'])
示例#3
0
class MyTestCase(unittest.TestCase):
    def setUp(self) -> None:
        config_loc = 'config.json'
        with open(config_loc, 'r') as f:
            config = json.load(f)
        config_loc = 'config.json'
        engine = prepare_engine(config_loc)
        db_interface = MySQLInterface(engine)
        self.jq_data = JQData(db_interface, config['jq_mobile'], config['jq_password'])

    def test_jq_login(self):
        self.jq_data.update_convertable_bond_list()
示例#4
0
def daily_routine(config_loc: str):
    set_global_config(config_loc)

    with TushareData() as tushare_crawler:
        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()
        tushare_crawler.update_financial_data()

    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()
        wind_data.update_pause_stock_info()

        wind_data.update_convertible_bond_daily_data()
        wind_data.update_cb_convertible_price()
        wind_data.update_future_daily_data()
        wind_data.update_fund_extra_info()
        wind_data.update_fund_info()
        wind_data.update_stock_option_daily_data()

    with JQData() as jq_data:
        jq_data.update_stock_morning_auction_data()

    with TDXData() as tdx_data:
        tdx_data.update_stock_minute()
        tdx_data.update_convertible_bond_minute()

    # compute data
    ConstLimitStockFactorCompositor().update()
    NegativeBookEquityListingCompositor().update()
    IndexUpdater().update()

    # model data
    SMBandHMLCompositor().update()
    UMDCompositor().update()
示例#5
0
    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()
        wind_data.update_pause_stock_info()

        wind_data.update_convertible_bond_daily_data()
        wind_data.update_future_daily_data()
        wind_data.update_stock_option_daily_data()

    with JQData() as jq_data:
        jq_data.update_stock_morning_auction_data()
        jq_data.update_stock_minute()

    ConstLimitStockFactorCompositor().update()
示例#6
0
 def setUp(self) -> None:
     set_global_config('config.json')
     self.jq_data = JQData()
示例#7
0
import datetime as dt
import json
import sys

from DingTalkMessageBot import DingTalkMessageBot

from AShareData import JQData, MySQLInterface, prepare_engine, TushareData

if __name__ == '__main__':
    config_loc = sys.argv[1]
    date = dt.date.today()
    with open(config_loc, 'r') as f:
        config = json.load(f)
    engine = prepare_engine(config_loc)
    db_interface = MySQLInterface(engine)

    tushare_crawler = TushareData(config['tushare_token'],
                                  db_interface=db_interface)
    tushare_crawler.get_ipo_info()

    token = '076314e3a582ce36705d53dc0b822493c046447b82e3cfb1571850debe500b15'
    secret = 'SEC2931f95f8d27145c579b8f37eb479fc587a3caec441829b5a4999b90271286c4'
    messenger = DingTalkMessageBot(token, secret)
    try:
        with JQData(db_interface, config['jq_mobile'],
                    config['jq_password']) as jq_data:
            jq_data.stock_open_auction_data(date)
            messenger.send_message(f'{date} 集合竞价数据已下载.')
    except:
        messenger.send_message(f'{date} 集合竞价数据下载失败.')