def country_data(country): conn = scp_data.get_conn() cursor = conn.cursor(cursor=pymysql.cursors.DictCursor) cursor.execute( "select date_format(stat_date,'%c-%d') as dateTime,sum(active) active,sum(Recovered) Recovered,sum(Deaths) Deaths,sum(Confirmed) Confirmed from data where country = '" + country + "' group by date_format(stat_date,'%c-%d')") data = cursor.fetchall() print(data) return jsonify(data)
def alll(time): print('get country data') conn = scp_data.get_conn() cursor = conn.cursor(cursor=pymysql.cursors.DictCursor) cursor.execute("select * from data where stat_date=str_to_date('" + time + "','%Y-%m-%d')") data = cursor.fetchall() print(data) return jsonify(data)
def getTime(): print('get getTime data') conn = scp_data.get_conn() cursor = conn.cursor(cursor=pymysql.cursors.DictCursor) cursor.execute("select distinct date_format(stat_date,'%Y-%m-%d') as stat_date from data") data = cursor.fetchall() print(data) return jsonify(data)
def country(): print('get country data') conn = scp_data.get_conn() cursor = conn.cursor(cursor=pymysql.cursors.DictCursor) cursor.execute("select distinct country from data") data = cursor.fetchall() print(data) return jsonify(data)
def getTime(): print('get getTime data') conn = scp_data.get_conn() cursor = get_cursor(conn) cursor.execute("select distinct strftime('%Y-%m-%d',stat_date) as stat_date from data") data = cursor.fetchall() print(data) return jsonify(data)
def alll(time): print('get country data') conn = scp_data.get_conn() cursor = get_cursor(conn) cursor.execute("select * from data where stat_date=datetime('" + time + "')") data = cursor.fetchall() print(data) return jsonify(data)
def country(): print('get country data') conn = scp_data.get_conn() cursor = get_cursor(conn) cursor.execute("select distinct country from data") data = cursor.fetchall() print(data) return jsonify(data)
def country_data(country): conn = scp_data.get_conn() cursor = get_cursor(conn) cursor.execute( "select strftime('%m-%d',stat_date) as dateTime,sum(active) active,sum(Recovered) Recovered,sum(Deaths) Deaths,sum(Confirmed) Confirmed from data where country = '" + country + "' group by strftime('%m-%d',stat_date)") data = cursor.fetchall() print(data) return jsonify(data)
def top10_time(time): print('get top10 data') conn = scp_data.get_conn() cursor = conn.cursor(cursor=pymysql.cursors.DictCursor) cursor.execute( "select country,sum(active) active,sum(Recovered) Recovered,sum(Deaths) Deaths,sum(Confirmed) Confirmed from data where stat_date=str_to_date('" + time + "','%Y-%m-%d') group by country order by sum(Confirmed) desc limit 10") data = cursor.fetchall() print(data) return jsonify(data)
def top10_time(time): print('get top10 data') conn = scp_data.get_conn() cursor = get_cursor(conn) sql = "select country,sum(active) active,sum(Recovered) Recovered,sum(Deaths) Deaths,sum(Confirmed) Confirmed from data where stat_date=datetime('" + time + "') group by country order by sum(Confirmed) desc limit 10" print(sql) cursor.execute(sql) data = cursor.fetchall() print(data) return jsonify(data)