def __load_latest_prices_from_gnucash(self, symbol):
        """ Load security prices from GnuCash book. Deprecated. """
        book = self.get_gc_book()

        svc = SecuritiesAggregate(book)
        agg = svc.get_aggregate_for_symbol(symbol)
        if not agg:
            raise ValueError(f"Security not found {symbol}!")
        price: piecash.Price = agg.get_last_available_price()
        if not price:
            raise ValueError(f"Price not found for {symbol}!")

        # Map to price model.
        result = PriceModel()
        result.value = price.value
        result.currency = price.currency.mnemonic
        return result
def __load_latest_prices_from_gnucash ( self , symbol ) : book = self . get_gc_book ( ) svc = SecuritiesAggregate ( book ) agg = svc . get_aggregate_for_symbol ( symbol ) if not agg : raise ValueError ( f"Security not found {symbol}!" ) price : piecash . Price = agg . get_last_available_price ( ) if not price : raise ValueError ( f"Price not found for {symbol}!" ) result = PriceModel ( ) result . value = price . value result . currency = price . currency . mnemonic return result
Load security prices from GnuCash book. Deprecated.