pricedb/cli.py
def last(symbol: str):
    """ displays last price, for symbol if provided """
    app = PriceDbApplication()

    # convert to uppercase
    if symbol:
        symbol = symbol.upper()
        # extract namespace
        sec_symbol = SecuritySymbol("", "")
        sec_symbol.parse(symbol)

        latest = app.get_latest_price(sec_symbol)
        assert isinstance(latest, PriceModel)
        print(f"{latest}")
    else:
        # Show the latest prices available for all securities.
        latest = app.get_latest_prices()
        for price in latest:
            print(f"{price}")
def last(symbol: str):
    """ displays last price, for symbol if provided """
    app = PriceDbApplication()

    # convert to uppercase
    if symbol:
        symbol = symbol.upper()
        # extract namespace
        sec_symbol = SecuritySymbol("", "")
        sec_symbol.parse(symbol)

        latest = app.get_latest_price(sec_symbol)
        assert isinstance(latest, PriceModel)
        print(f"{latest}")
    else:
        # Show the latest prices available for all securities.
        latest = app.get_latest_prices()
        for price in latest:
            print(f"{price}")
def last ( symbol : str ) : app = PriceDbApplication ( ) # convert to uppercase if symbol : symbol = symbol . upper ( ) # extract namespace sec_symbol = SecuritySymbol ( "" , "" ) sec_symbol . parse ( symbol ) latest = app . get_latest_price ( sec_symbol ) assert isinstance ( latest , PriceModel ) print ( f"{latest}" ) else : # Show the latest prices available for all securities. latest = app . get_latest_prices ( ) for price in latest : print ( f"{price}" )
displays last price, for symbol if provided
displays last price for symbol if provided