notify.py
def main():
    """Check the courses of some stocks and send a push notification if these
    stocks cross certain high or low marks."""
    stocks = read_stocks("stocks.json")
    currency_converter = cc.CurrencyConverter()

    today_date = dt.datetime.now().date()
    today = str(dt.datetime.now().date())
    tomorrow = str(today_date + dt.timedelta(days=1))

    for stock, details in stocks.items():
        ticker = yf.Ticker(details["ticker_symbol"])
        df = ticker.history(period="1d", start=today, end=tomorrow)

        rate = currency_converter.convert(1, details.get("currency", "EUR"), "EUR")
        price_euros = df.iloc[0]["Open"] * rate

        if price_euros < details["low"]:
            send_pushover(f"Price for {stock} is low: {price_euros:0.2f}€")
        elif price_euros > details["high"]:
            send_pushover(f"Price for {stock} is high: {price_euros:0.2f}€")
Check the courses of some stocks and send a push notification if these
    stocks cross certain high or low marks.
Check the courses of some stocks and send a push notification if these
stocks cross certain high or low marks.
Check the courses of some stocks and send a push notification if these stocks cross certain high or low marks .
def main():
    stocks = read_stocks("stocks.json")
    currency_converter = cc.CurrencyConverter()
    today_date = dt.datetime.now().date()
    today = str(dt.datetime.now().date())
    tomorrow = str(today_date + dt.timedelta(days=1))
    for stock, details in stocks.items():
        ticker = yf.Ticker(details["ticker_symbol"])
        df = ticker.history(period="1d", start=today, end=tomorrow)
        rate = currency_converter.convert(1, details.get("currency", "EUR"), "EUR")
        price_euros = df.iloc[0]["Open"] * rate
        if price_euros < details["low"]:
            send_pushover(f"Price for {stock} is low: {price_euros:0.2f}€")
        elif price_euros > details["high"]:
            send_pushover(f"Price for {stock} is high: {price_euros:0.2f}€")
def main ( ) : stocks = read_stocks ( "stocks.json" ) currency_converter = cc . CurrencyConverter ( ) today_date = dt . datetime . now ( ) . date ( ) today = str ( dt . datetime . now ( ) . date ( ) ) tomorrow = str ( today_date + dt . timedelta ( days = 1 ) ) for stock , details in stocks . items ( ) : ticker = yf . Ticker ( details [ "ticker_symbol" ] ) df = ticker . history ( period = "1d" , start = today , end = tomorrow ) rate = currency_converter . convert ( 1 , details . get ( "currency" , "EUR" ) , "EUR" ) price_euros = df . iloc [ 0 ] [ "Open" ] * rate if price_euros < details [ "low" ] : send_pushover ( f"Price for {stock} is low: {price_euros:0.2f}€") elif price_euros > details [ "high" ] : send_pushover ( f"Price for {stock} is high: {price_euros:0.2f}€")
Check the courses of some stocks and send a push notification if these
stocks cross certain high or low marks.
Check the courses of some stocks and send a push notification if these stocks cross certain high or low marks .
"""Check the courses of some stocks and send a push notification if these
    stocks cross certain high or low marks."""