pricedb/app.py
def download_prices(self, **kwargs):
        """ Downloads all the prices that are listed in the Security table.
        Accepts filter arguments: currency, agent, symbol, namespace.
        """
        currency: str = kwargs.get('currency', None)
        if currency:
            currency = currency.upper()
        agent: str = kwargs.get('agent', None)
        if agent:
            agent = agent.upper()
        symbol: str = kwargs.get('symbol', None)
        if symbol:
            symbol = symbol.upper()
        namespace: str = kwargs.get('namespace', None)
        if namespace:
            namespace = namespace.upper()
        securities = self.__get_securities(currency, agent, symbol, namespace)
        #self.logger.debug(securities)

        for sec in securities:
            symbol = f"{sec.namespace}:{sec.symbol}"
            currency = sec.currency
            agent = sec.updater
            #self.logger.debug(f"Initiating download for {symbol} {currency} with {agent}...")
            try:
                self.__download_price(symbol.strip(), currency, agent)
            except Exception as e:
                self.logger.error(str(e))
        self.save()
def download_prices(self, **kwargs):
        """ Downloads all the prices that are listed in the Security table.
        Accepts filter arguments: currency, agent, symbol, namespace.
        """
        currency: str = kwargs.get('currency', None)
        if currency:
            currency = currency.upper()
        agent: str = kwargs.get('agent', None)
        if agent:
            agent = agent.upper()
        symbol: str = kwargs.get('symbol', None)
        if symbol:
            symbol = symbol.upper()
        namespace: str = kwargs.get('namespace', None)
        if namespace:
            namespace = namespace.upper()
        securities = self.__get_securities(currency, agent, symbol, namespace)
        #self.logger.debug(securities)

        for sec in securities:
            symbol = f"{sec.namespace}:{sec.symbol}"
            currency = sec.currency
            agent = sec.updater
            #self.logger.debug(f"Initiating download for {symbol} {currency} with {agent}...")
            try:
                self.__download_price(symbol.strip(), currency, agent)
            except Exception as e:
                self.logger.error(str(e))
        self.save()
def download_prices ( self , * * kwargs ) : currency : str = kwargs . get ( 'currency' , None ) if currency : currency = currency . upper ( ) agent : str = kwargs . get ( 'agent' , None ) if agent : agent = agent . upper ( ) symbol : str = kwargs . get ( 'symbol' , None ) if symbol : symbol = symbol . upper ( ) namespace : str = kwargs . get ( 'namespace' , None ) if namespace : namespace = namespace . upper ( ) securities = self . __get_securities ( currency , agent , symbol , namespace ) #self.logger.debug(securities) for sec in securities : symbol = f"{sec.namespace}:{sec.symbol}" currency = sec . currency agent = sec . updater #self.logger.debug(f"Initiating download for {symbol} {currency} with {agent}...") try : self . __download_price ( symbol . strip ( ) , currency , agent ) except Exception as e : self . logger . error ( str ( e ) ) self . save ( )
Downloads all the prices that are listed in the Security table.
        Accepts filter arguments: currency, agent, symbol, namespace.
Downloads all the prices that are listed in the Security table . Accepts filter arguments : currency agent symbol namespace .