@@ -0,0 +1,1233 @@
+import logging%0Aimport sys%0Afrom sqlalchemy.orm import sessionmaker%0Afrom models import NbaGame, NbaPlayer, create_tables, db_connect%0Afrom classes import NbaScheduleSheet%0A%0Alogger = logging.getLogger()%0Alogger.setLevel(logging.INFO)%0Ahandler = logging.StreamHandler()%0Alogger.addHandler(handler)%0A%0Adef init_db_con():%0A    try:%0A        engine = db_connect()%0A        create_tables(engine)%0A        Session = sessionmaker(bind=engine)%0A        session = Session()%0A        logger.info(%22SUCCESS: Connection to mysql instance succeeded%22)%0A%0A        return session%0A    except:%0A        logger.error(%22ERROR: Unexpected error: Could not connect to mysql instance.%22)%0A        sys.exit()%0A%0A%0Adef update_schedule():%0A    session = init_db_con()%0A%0A%0A%0A%0Adef update_player_games(event, context):%0A    session = init_db_con()%0A%0A    try:%0A        for yahoo_id in event%5B'yahoo_ids'%5D:%0A            nba_player = NbaPlayerPage(yahoo_id)%0A            nba_player.update_player_info(session)%0A            nba_player.update_games(session)%0A%0A        session.commit()%0A    except Exception as e:%0A        print(e)%0A        session.rollback()%0A        raise%0A    finally:%0A        session.close()%0A%0A%0A# if __name__ == %22__main__%22:%0A    # main(%5B'4750', '4942'%5D)%0A    # nba_player = NbaPlayer('4942')%0A%0A

Add handlers file for receiving lambda events