def initDB(): """初始化数据库 """ global mydb if os.path.exists('test.sqlite'): mydb = MyDB("test.sqlite") else: mydb = MyDB("test.sqlite") mydb.sql(''' CREATE TABLE Quotes (ID INTEGER PRIMARY KEY AUTOINCREMENT, md5 TEXT NOT NULL, Quote TEXT NOT NULL );''')
def get_province_currentConfirmedCount(): mydb = MyDB('localhost', 'root', 'kfq991122', 'covid19') results = mydb.get_province_currentConfirmedCount() return jsonify(provinceShortName=[x[0] for x in results], currentConfirmedCount=[x[1] for x in results], pub_date=results[0][2])
def get_history(self): try: mylock.lock.acquire() conn = MyDB().get_db() df = pd.read_sql_query( """select symbol , business_date , open , high , low , close , volume from ohlc where symbol = '%s' and business_date between '%s' and '%s' order by business_date """ % (self.symbol, self.start_date, self.end_date), conn) df = df.fillna(method='ffill') except Exception as err: print(err) finally: if conn: self.quotes = df conn.close else: self.quotes = None mylock.lock.release()
def get_home_realtime_datas(): mydb = MyDB('localhost', 'root', 'kfq991122', 'covid19') results = mydb.get_home_realtime_datas() return jsonify(curConfirm =[x[0] for x in results] ,curConfirmRelative=[x[1] for x in results],asymptomatic=[x[2] for x in results], asymptomaticRelative=[x[3] for x in results], \ unconfirmed=[x[4] for x in results], unconfirmedRelative=[x[5] for x in results], icu=[x[6] for x in results], icuRelative=[x[7] for x in results],confirmed=[x[8] for x in results],confirmedRelative=[x[9] for x in results],\ overseasInput=[x[10] for x in results],overseasInputRelative=[x[11] for x in results],cured=[x[12] for x in results],curedRelative=[x[13] for x in results],died=[x[14] for x in results],diedRelative=[x[15] for x in results])
def main(): args = parse_arg() outdir, src_path, db_path = mk_dirs(args.outdir) with MyDB(os.path.join(db_path, db_file_name)) as db: db.createdb() for lang in args.langs: for i in range(args.p_start, args.p_end + 1): print "Processing [{now}/{all}].".format(now=i, all=args.p_end) url = construct_url(query, p=i, per_page=per_page, langs=[lang]) print url data = get_json_from_url(url) if not data: continue useful_count = 0 for r in data['results']: posts = get_posts_from(r['lines']) # store file and repo info into db para = extract_para(r, posts) db.insertfile(**para) if len(posts) > 0: # code has some real SO links write_code_to_file(para['fid'], src_path) useful_count += 1 print "{useful}/{total} are useful files on this page." \ .format(useful=useful_count, total=len(data['results']))
def test_employ_query2(): db = MyDB() conn = db.connect("server") cur = conn.cursor() id = cur.execute("select id from employee where name=tom") assert id == 789 cur.close() conn.close()
def cur(): print("setting up") db = MyDB() conn = db.connect("server") curs = conn.cursor() yield curs curs.close() conn.close() print("closing DB")
def cur(): print "\nopen DB" db = MyDB() conn = db.connect("server") curs = conn.cursor() yield curs conn.close() curs.close() print "\nclose DB"
def cursorFixture(): print("setting up") db = MyDB() conn = db.connect('server') cursor = conn.cursor() yield cursor #we will get to this point only after all references of cursor are passed to the relavant tests. conn.close() cursor.close() print(" teardown complete")
def cur(): print("Setting up.....") db = MyDB() conn = db.connect("server") cur_ = conn.cursor() yield cur_ cur_.close() conn.close() print("closing database....")
def get_maxdrawdown(self, symbol, strategy_id, strategy_option, start_date, end_date): conn = MyDB().get_db() c = conn.cursor() #cash+建玉(取得価格) c.execute(""" select business_date ,cash ,pos_price ,pos_vol from backtest_history where symbol = '{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date}' and '{end_date}' order by business_date """.format(symbol=symbol, strategy_id=strategy_id, strategy_option=strategy_option, start_date=start_date, end_date=end_date)) rs = c.fetchall() conn.close() maxv = 0 minv = 0 max_drawdown = 0 business_date = '' drawdown = 0 count = 0 if rs: for r in rs: v = r[1] + (r[2] * r[3]) if count == 0: maxv = v minv = v elif maxv < v: maxv = v minv = v elif minv > v: minv = v diff = maxv - minv drawdown = self.round(diff / maxv) if max_drawdown < drawdown: max_drawdown = drawdown business_date = r[0] count += 1 self.logger.info( "maxdrawdown:{symbol},{strategy_id},{strategy_option},{start_date},{end_date},{business_date},{max_drawdown}" .format(symbol=symbol, strategy_id=strategy_id, strategy_option=strategy_option, start_date=start_date, end_date=end_date, business_date=business_date, max_drawdown=max_drawdown)) return max_drawdown
def get_province_daily_datas(): mydb = MyDB('localhost', 'root', 'kfq991122', 'covid19') results = mydb.get_province_daily_datas() return jsonify(provinceName=[x[0] for x in results], provinceShortName=[x[1] for x in results], currentConfirmedCount=[x[2] for x in results], confirmedCount=[x[3] for x in results], suspectedCount=[x[4] for x in results], curedCount=[x[5] for x in results], deadCount=[x[6] for x in results])
def get_outside_realtime_datas(): mydb = MyDB('localhost', 'root', 'kfq991122', 'covid19') results = mydb.get_outside_realtime_datas() return jsonify(confirmedCount=[x[0] for x in results], currentConfirmedCount=[x[1] for x in results], confirmedIncr=[x[2] for x in results], curedCount=[x[3] for x in results], curedIncr=[x[4] for x in results], deadCount=[x[5] for x in results], deadIncr=[x[6] for x in results])
def __init__(self): wordpress_detector = WPDetector() joomla_detector = JoomlaDetector() squarespace_detector = SquarspaceDetector() drupal_detector = drupalDetector() detectors = [ wordpress_detector, joomla_detector, squarespace_detector, drupal_detector ] self._mydb = MyDB() self._mydb.connect() self._model = Model(detectors)
def get_max_businessdate_from_ohlc(symbols): conn = MyDB().get_db() c = conn.cursor() #ohlcの最終登録日を取得 c.execute( """ select max(business_date) from ohlc where symbol in ({0})""".format(', '.join('?' for _ in symbols)), symbols) max_date = c.fetchone() conn.close() return max_date[0]
def main(): def process_data(r): db.update_repo(**r) # print r args = parse_arg() outdir, src_path, db_path = mk_dirs(args.outdir) with MyDB(os.path.join(db_path, db_file_name)) as db: rows = db.select_all_repos() gc = GitHubCrawler(rows, process_data, config['login'], config['password']) gc.start(args.force_commits, args.force_stars)
def get_bollingerband_closeondaily_settings(symbol): conn = MyDB().get_db() c = conn.cursor() c.execute(""" select symbol ,sma ,sigma1 from bollingerband_closeondaily where symbol = '{symbol}' """.format(symbol=symbol)) rs = c.fetchall() conn.close() return rs
def insert_history(self, quotes): try: conn = MyDB().get_db() c = conn.cursor() c.executemany( 'INSERT OR REPLACE INTO ohlc(symbol, business_date, open, high, low, close, volume) VALUES(?,?,?,?,?,?,?)', quotes) except Exception as err: self.logger.error('error dayo. {0}'.format(err)) if conn: conn.rollback() finally: if conn: conn.commit() conn.close
def cur(): print("setting up dB") # create the database object--this will give me DB object db = MyDB() # you always need to connect your DB to a server -- this would normally be acutal server conn = db.connect("server") # next we will get a cursor object curs = conn.cursor() # it will create the cursor object only once, and then it will pass the cursor object to test cases # after this is complete, it will close the cursor and connection yield curs curs.close() conn.close() print("closing dB")
def cur(): print("Setting up") db = MyDB() # instance of the class of MDB conn = db.connect("127.0.0.1") curs = conn.cursor() return curs
def update_maxdrawdown(self, symbols, strategy_id): (end_date, start_date, start_date_3month, start_date_1year, start_date_3year, start_date_15year) = self.get_dates() #バックテスト結果を取得 conn = MyDB().get_db() c = conn.cursor() c.execute( """ select symbol ,strategy_id ,strategy_option from backtest_result where symbol in ({symbols}) and strategy_id = {strategy_id} """.format(symbols=', '.join('?' for _ in symbols), strategy_id=strategy_id), symbols) rs = c.fetchall() conn.close() #ドローダウン算出 for r in rs: symbol = r[0] strategy_id = r[1] strategy_option = r[2] drawdown = self.get_maxdrawdown(symbol, strategy_id, strategy_option, start_date, end_date) drawdown_3month = self.get_maxdrawdown(symbol, strategy_id, strategy_option, start_date_3month, end_date) drawdown_1year = self.get_maxdrawdown(symbol, strategy_id, strategy_option, start_date_1year, end_date) drawdown_3year = self.get_maxdrawdown(symbol, strategy_id, strategy_option, start_date_3year, end_date) drawdown_15year = self.get_maxdrawdown(symbol, strategy_id, strategy_option, start_date_15year, end_date) #DB更新 conn = MyDB().get_db() c = conn.cursor() c.execute(""" update backtest_result set drawdown = {drawdown} ,drawdown_3month = {drawdown_3month} ,drawdown_1year = {drawdown_1year} ,drawdown_3year = {drawdown_3year} ,drawdown_15year = {drawdown_15year} where symbol = '{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' """.format(symbol=symbol, strategy_id=strategy_id, strategy_option=strategy_option, drawdown=drawdown, drawdown_3month=drawdown_3month, drawdown_1year=drawdown_1year, drawdown_3year=drawdown_3year, drawdown_15year=drawdown_15year)) self.logger.info( "update_drawdown() {symbol},{strategy_id},{strategy_option}". format(symbol=symbol, strategy_id=strategy_id, strategy_option=strategy_option)) conn.commit() conn.close()
def update_expected_rate(self, symbols, strategy_id): self.logger.info("update_expected_rate()") (end_date, start_date, start_date_3month, start_date_1year, start_date_3year, start_date_15year) = self.get_dates() #backtest_result table取得 conn = MyDB().get_db() c = conn.cursor() c.execute( """ select symbol ,strategy_id ,strategy_option from backtest_result where symbol in ({symbols}) and strategy_id = {strategy_id} """.format(symbols=', '.join('?' for _ in symbols), strategy_id=strategy_id), symbols) rs = c.fetchall() conn.close() for r in rs: self.logger.info("{symbol},{strategy_id},{strategy_option}".format( symbol=r[0], strategy_id=r[1], strategy_option=r[2])) conn = MyDB().get_db() c = conn.cursor() c.execute(""" update backtest_result set profit_rate_3month = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3month}' and '{end_date}' group by symbol, strategy_id, strategy_option ) ,profit_rate_1year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_1year}' and '{end_date}' group by symbol, strategy_id, strategy_option ) ,profit_rate_3year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3year}' and '{end_date}' group by symbol, strategy_id, strategy_option ) ,profit_rate_15year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_15year}' and '{end_date}' group by symbol, strategy_id, strategy_option ) ,long_profit_rate_3month = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3month}' and '{end_date}' and execution_order_type in (5,7,11) group by symbol, strategy_id, strategy_option ) ,long_profit_rate_1year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_1year}' and '{end_date}' and execution_order_type in (5,7,11) group by symbol, strategy_id, strategy_option ) ,long_profit_rate_3year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3year}' and '{end_date}' and execution_order_type in (5,7,11) group by symbol, strategy_id, strategy_option ) ,long_profit_rate_15year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_15year}' and '{end_date}' and execution_order_type in (5,7,11) group by symbol, strategy_id, strategy_option ) ,short_profit_rate_3month = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3month}' and '{end_date}' and execution_order_type in (6,8,12) group by symbol, strategy_id, strategy_option ) ,short_profit_rate_1year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_1year}' and '{end_date}' and execution_order_type in (6,8,12) group by symbol, strategy_id, strategy_option ) ,short_profit_rate_3year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3year}' and '{end_date}' and execution_order_type in (6,8,12) group by symbol, strategy_id, strategy_option ) ,short_profit_rate_15year = ( select round(sum(profit_rate) ,4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_15year}' and '{end_date}' and execution_order_type in (6,8,12) group by symbol, strategy_id, strategy_option ) ,expected_rate_3month = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3month}' and '{end_date}' group by symbol, strategy_id, strategy_option ) ,expected_rate_1year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_1year}' and '{end_date}' group by symbol, strategy_id, strategy_option ) ,expected_rate_3year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3year}' and '{end_date}' group by symbol, strategy_id, strategy_option ) ,expected_rate_15year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_15year}' and '{end_date}' group by symbol, strategy_id, strategy_option ) ,long_expected_rate_3month = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3month}' and '{end_date}' and execution_order_type in (5,7,11) group by symbol, strategy_id, strategy_option ) ,long_expected_rate_1year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_1year}' and '{end_date}' and execution_order_type in (5,7,11) group by symbol, strategy_id, strategy_option ) ,long_expected_rate_3year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3year}' and '{end_date}' and execution_order_type in (5,7,11) group by symbol, strategy_id, strategy_option ) ,long_expected_rate_15year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_15year}' and '{end_date}' and execution_order_type in (5,7,11) group by symbol, strategy_id, strategy_option ) ,short_expected_rate_3month = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3month}' and '{end_date}' and execution_order_type in (6,8,12) group by symbol, strategy_id, strategy_option ) ,short_expected_rate_1year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_1year}' and '{end_date}' and execution_order_type in (6,8,12) group by symbol, strategy_id, strategy_option ) ,short_expected_rate_3year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_3year}' and '{end_date}' and execution_order_type in (6,8,12) group by symbol, strategy_id, strategy_option ) ,short_expected_rate_15year = ( select round(sum(profit_rate) / count(profit_rate), 4) from backtest_history where symbol='{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' and business_date between '{start_date_15year}' and '{end_date}' and execution_order_type in (6,8,12) group by symbol, strategy_id, strategy_option ) where symbol = '{symbol}' and strategy_id = {strategy_id} and strategy_option = '{strategy_option}' """.format(symbol=r[0], strategy_id=r[1], strategy_option=r[2], end_date=end_date, start_date_3month=start_date_3month, start_date_1year=start_date_1year, start_date_3year=start_date_3year, start_date_15year=start_date_15year)) conn.commit() conn.close()
def save_history(self, backtest_history): try: mylock.lock.acquire() conn = MyDB().get_db() c = conn.cursor() c.executemany( """ insert or replace into backtest_history ( symbol, strategy_id, strategy_option, business_date, open, high, low, close, volume, sma, upper_sigma1, lower_sigma1, upper_sigma2, lower_sigma2, vol_sma, vol_upper_sigma1, vol_lower_sigma1, order_create_date, order_type, order_vol, order_price, call_order_date, call_order_type, call_order_vol, call_order_price, execution_order_date, execution_order_type, execution_order_status, execution_order_vol, execution_order_price, position, cash, pos_vol, pos_price, total_value, profit_value, profit_rate, leverage ) values ( ? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ) """, backtest_history) except Exception as err: if conn: conn.rollback() self.logger.error(err) finally: if conn: conn.commit() conn.close mylock.lock.release()
def save_simulate_result( self, symbol, strategy_id, strategy_option, start_date, end_date, market_start_date, market_end_date, backtest_period, trading_period, average_period_per_trade, initial_assets, last_assets, rate_of_return, win_count, loss_count, win_value, loss_value, win_rate, payoffratio, expected_rate, expected_rate_per_1day, long_win_count, long_loss_count, long_win_value, long_loss_value, long_win_rate, long_payoffratio, long_expected_rate, long_expected_rate_per_1day, short_win_count, short_loss_count, short_win_value, short_loss_value, short_win_rate, short_payoffratio, short_expected_rate, short_expected_rate_per_1day, regist_date): try: mylock.lock.acquire() conn = MyDB().get_db() c = conn.cursor() c.execute( """ insert or replace into backtest_result ( symbol ,strategy_id ,strategy_option ,start_date ,end_date ,market_start_date ,market_end_date ,backtest_period ,trading_period ,average_period_per_trade ,initial_assets ,last_assets ,rate_of_return ,win_count ,loss_count ,win_value ,loss_value ,win_rate ,payoffratio ,expected_rate ,expected_rate_per_1day ,long_win_count ,long_loss_count ,long_win_value ,long_loss_value ,long_win_rate ,long_payoffratio ,long_expected_rate ,long_expected_rate_per_1day ,short_win_count ,short_loss_count ,short_win_value ,short_loss_value ,short_win_rate ,short_payoffratio ,short_expected_rate ,short_expected_rate_per_1day ,regist_date ) values ( ? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ) """, (symbol, strategy_id, strategy_option, start_date, end_date, market_start_date, market_end_date, backtest_period, trading_period, average_period_per_trade, initial_assets, last_assets, rate_of_return, win_count, loss_count, win_value, loss_value, win_rate, payoffratio, expected_rate, expected_rate_per_1day, long_win_count, long_loss_count, long_win_value, long_loss_value, long_win_rate, long_payoffratio, long_expected_rate, long_expected_rate_per_1day, short_win_count, short_loss_count, short_win_value, short_loss_value, short_win_rate, short_payoffratio, short_expected_rate, short_expected_rate_per_1day, regist_date)) except Exception as err: if conn: conn.rollback() self.logger.error(err) finally: if conn: conn.commit() conn.close mylock.lock.release()
@author dolphin @description - Allow the user to input the list of phrases via a Swagger. - Request product info to B and get info from it. - Allow the user to check to view the results. """ from fastapi import FastAPI, Query from models import SearchTerms, ProductInfo, _SERVER_A_URL, _SERVER_B_URL from typing import List import requests import aiohttp import asyncio from mydb import MyDB mydb = MyDB() app = FastAPI() prodInfo = ProductInfo("test title", 41.6, 192.6) @app.get("/") def read_root(): return {"Success": "This is server A on my test project using FastAPI."} """ Send asynchronous request to server B to scrap search_terms. """ def send_async_req(search_terms): req_sent = 0
def setup_module(module): global conn global cur db = MyDB() conn = db.connect("server") cur = conn.cursor()
def get_db_handler(): if not get_db_handler.handler: get_db_handler.handler = MyDB(DB_NAME) return get_db_handler.handler
import urllib.parse from mydb import MyDB from lxml import etree from ScanProxy import ScanProxy import pdb ############## Config ################################ keyword = "手机赚钱软件" #搜索的关键词 maxPage = 100 #抓取的最大列表页页码 ############## End Config ############################ ############## Public Var ############################ urlList = [] proxyList = [] history_urlList = [] db = MyDB() ############## End Public ############################ ############## Function ############################## def userAgentRand(): l = [] l.append( "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" ) l.append("Mozilla/5.0 (Windows NT 6.1; W…) Gecko/20100101 Firefox/61.0") l.append("Mozilla/4.0(compatible;MSIE8.0;WindowsNT6.0;Trident/4.0)") l.append("Mozilla/5.0(WindowsNT6.1;rv:2.0.1)Gecko/20100101Firefox/4.0.1") l.append("Mozilla/4.0(compatible;MSIE7.0;WindowsNT5.1;TencentTraveler4.0)") l.append("Mozilla/4.0(compatible;MSIE7.0;WindowsNT5.1;TheWorld)")
def __init__(s): s.mydb=MyDB() s.myf=MyFile()
def toget_home_daily_datas(): mydb = MyDB('localhost', 'root', 'kfq991122', 'covid19') results = mydb.get_home_daily_datas() return jsonify(curConfirm=[x[0] for x in results], time=[x[1] for x in results])