Ejemplo n.º 1
0
def getLastTableDate(mysql_conn,ticker):
    
    query = "SELECT max(date) as date from investing.stats where ticker = '{}';".format(ticker) 
    
    max_date = MySQL_func.execute_select_query(mysql_conn,query=query)['date'].iloc[0]
    
    return max_date
Ejemplo n.º 2
0
def getTickerData(mysql_conn, ticker):
    max_date = getLastTableDate(mysql_conn,ticker)
    
    query = "select * from investing.stats where date = '{}' AND ticker = '{}';".format(max_date,ticker)
    
    stats_data = MySQL_func.execute_select_query(mysql_conn,query=query)
    
    return stats_data
Ejemplo n.º 3
0
def getAllTickers():
    host_name = 'localhost'
    user = '******'
    passwd = 'root'
    db_name = 'investing'
    mysql_conn = MySQL_func.connect_to_mysql_db(host_name,db_name,user,passwd)
    
    query = "SELECT ticker from investing.stats group by ticker;"
    
    tickers = MySQL_func.execute_select_query(mysql_conn,query=query)['ticker'].to_list()
    
    return tickers