stocks/tasks.py
def download_moex_data_task():
    '''
    Downloads MOEX XML files with end-of-day data
    '''
    root_path = os.path.abspath(os.path.dirname(__name__))
    provider = MarketDataProvider.objects.get(title='MOEX')
    storage_path = root_path + '/static/data/' + provider.folder
    # MOEX historical data available only on the next day
    timestamp = datetime.now() - timedelta(days=1)
    xml_paths = download_share_data_moex_full(
        timestamp.strftime('%Y-%m-%d'),
        provider.url,
        storage_path
    )
    logger = download_moex_data_task.get_logger()
    for path in xml_paths:
        logger.info('Downloaded ' + path)
        loader = ShareDataItemLoader(path)
        loader.load_moex_xml(timestamp.date())

    Downloads MOEX XML files with end-of-day data
    
Downloads MOEX XML files with end-of-day data
Downloads MOEX XML files with end - of - day data
def download_moex_data_task():
    root_path = os.path.abspath(os.path.dirname(__name__))
    provider = MarketDataProvider.objects.get(title='MOEX')
    storage_path = root_path + '/static/data/' + provider.folder
    timestamp = datetime.now() - timedelta(days=1)
    xml_paths = download_share_data_moex_full(
        timestamp.strftime('%Y-%m-%d'),
        provider.url,
        storage_path
    )
    logger = download_moex_data_task.get_logger()
    for path in xml_paths:
        logger.info('Downloaded ' + path)
        loader = ShareDataItemLoader(path)
        loader.load_moex_xml(timestamp.date())
def download_moex_data_task ( ) : root_path = os . path . abspath ( os . path . dirname ( __name__ ) ) provider = MarketDataProvider . objects . get ( title = 'MOEX' ) storage_path = root_path + '/static/data/' + provider . folder timestamp = datetime . now ( ) - timedelta ( days = 1 ) xml_paths = download_share_data_moex_full ( timestamp . strftime ( '%Y-%m-%d' ) , provider . url , storage_path ) logger = download_moex_data_task . get_logger ( ) for path in xml_paths : logger . info ( 'Downloaded ' + path ) loader = ShareDataItemLoader ( path ) loader . load_moex_xml ( timestamp . date ( ) )
Downloads MOEX XML files with end-of-day data
Downloads MOEX XML files with end - of - day data
'''
    Downloads MOEX XML files with end-of-day data
    ''' # MOEX historical data available only on the next day