Exemplo n.º 1
0
def get_l1_data():
    d = []
    confirm = []
    for item in utils.get_l1_data():
        d.append(item[1].strftime("%Y-%m-%d"))
        confirm.append(int(item[0]))
    return jsonify({"date": d, "confirm": confirm})
Exemplo n.º 2
0
Arquivo: app.py Projeto: ch1762/cov
def get_l1_data():
    data = utils.get_l1_data()
    day, nowConfirm = [], []
    for a, b in data[3:]:
        day.append(a.strftime("%m-%d"))
        nowConfirm.append(b)
    return jsonify({"day": day, "nowConfirm": nowConfirm})
Exemplo n.º 3
0
def get_l1_data():
    data = utils.get_l1_data()
    date, conf_add = [], []
    for dt, ca in data:
        date.append(dt.strftime("%Y-%m-%d"))
        conf_add.append(ca)
    return jsonify({"date": date, "conf_add": conf_add})
Exemplo n.º 4
0
def get_l1_data():
    data = utils.get_l1_data()
    day, confirm, dead = [], [], []
    for a, b, c in data:
        day.append(a.strftime("%m-%d"))
        confirm.append(b)
        dead.append(c)
    return jsonify({"day": day, "confirm": confirm, "dead": dead})
Exemplo n.º 5
0
def get_l1_data():
    data = utils.get_l1_data()
    cost, time = [], []
    for a, b in data[0::10]:

        cost.append(a)
        time.append(b[6:10])

    return jsonify({"day": time, "cost": cost})
Exemplo n.º 6
0
def get_l1_data():
    data = utils.get_l1_data()
    brand = []
    num = []
    for k, v in data:
        brand.append(k)
        num.append(int(v))
    print(brand)
    return jsonify({"brand": brand, "num": num})
Exemplo n.º 7
0
def get_l1_data():
    data = utils.get_l1_data()
    day,confirm,suspect,heal,dead = [],[],[],[],[]
    for a,b,c,d,e in data[7:]:
        day.append(a.strftime("%m-%d")) #a是datatime类型
        confirm.append(b)
        suspect.append(c)
        heal.append(d)
        dead.append(e)
    return jsonify({"day":day,"confirm": confirm, "suspect": suspect, "heal": heal, "dead": dead})
Exemplo n.º 8
0
def get_l1_data():
    data = utils.get_l1_data()
    day, confirm, suspect, heal, dead = [], [], [], [], []
    for a, b, c, d, e in data[7:]:
        day.append(a.strftime('%m-%d'))
        confirm.append(b)
        suspect.append(c)
        heal.append(d)
        dead.append(e)
    return jsonify({'day': day, 'confirms': confirm, 'suspect': suspect, 'heal': heal, 'dead': dead})
Exemplo n.º 9
0
def get_l1_data():
    data = utils.get_l1_data()
    day, confirm, heal, dead = [], [], [], []
    for a, b, c, d in data[7:]:
        day.append(a.strftime("%m-%d"))
        confirm.append(b)
        heal.append(c)
        dead.append(d)
    return jsonify({
        "day": day,
        "confirm": confirm,
        "heal": heal,
        "dead": dead
    })
Exemplo n.º 10
0
def get_l1_data():
    day, confirm, suspect, heal, dead = [], [], [], [], []
    for a, b, c, d, e in utils.get_l1_data():
        day.append(a.strftime("%Y.%m.%d"))
        confirm.append(b)
        suspect.append(c)
        heal.append(d)
        dead.append(e)
    # 将字典转换成json
    return jsonify({
        "day": day,
        "confirm": confirm,
        "suspect": suspect,
        "heal": heal,
        "dead": dead
    })
Exemplo n.º 11
0
def get_l1_data():
    data = utils.get_l1_data()
    days, confirms, suspects, heals, deads = [], [], [], [], []
    for day, confirm, suspect, heal, dead in data[7:]:
        days.append(day.strftime("%m-%d"))
        confirms.append(confirm)
        suspects.append(suspect)
        heals.append(heal)
        deads.append(dead)
    return jsonify({
        'day': days,
        'confirm': confirms,
        'suspect': suspects,
        'heal': heals,
        'dead': deads
    })
Exemplo n.º 12
0
def get_l1_data():
    data = utils.get_l1_data()
    day, confirm, import_case, heal, dead = [], [], [], [], []
    for a, b, c, d, e in data[7:]:
        day.append(a.strftime("%m-%d"))  #a是datatime类型
        confirm.append(b)
        import_case.append(c)
        heal.append(d)
        dead.append(e)
    return jsonify({
        "day": day,
        "confirm": confirm,
        "import_case": import_case,
        "heal": heal,
        "dead": dead
    })
Exemplo n.º 13
0
def get_l1_data():
    data = utils.get_l1_data()
    day, confirm, suspect, heal, dead = [], [], [], [], []
    # 从data列表索引7开始,因为data[0:7]某些属性的值为none
    for a, b, c, d, e in data[7:]:
        day.append(a.strftime("%m-%d"))
        confirm.append(b)
        suspect.append(c)
        heal.append(d)
        dead.append(e)
    return jsonify({
        "day": day,
        "confirm": confirm,
        "suspect": suspect,
        "heal": heal,
        "dead": dead
    })
Exemplo n.º 14
0
Arquivo: app.py Projeto: kleinlsl/nCov
def get_l1_data():
    data = utils.get_l1_data()
    day, confirm, suspect, heal, dead, importedCase = [], [], [], [], [], []
    for a, b, c, d, e, f in data[:]:
        day.append(a.strftime("%m-%d"))
        confirm.append(b)
        suspect.append(c)
        heal.append(d)
        dead.append(e)
        importedCase.append(f)
    return jsonify({
        "day": day,
        "confirm": confirm,
        "suspect": suspect,
        "heal": heal,
        "dead": dead,
        "importedCase": importedCase
    })
Exemplo n.º 15
0
Arquivo: app.py Projeto: YCY1998/flask
def get_l1_data():
    res=utils.get_l1_data()
    ds=[]
    confrim=[]
    suspect=[]
    heal=[]
    dead=[]
    for i in res:
        
        tup="{:0>2d}.{:0>2d}".format(int(i[0].__getattribute__('month')),int(i[0].__getattribute__('day')))
        print(tup)
        # tup = time.strptime(i[0], "%Y-%m-%d %X")
        # time=time.strftime("%m.%d",tup)
        ds.append(tup)
        confrim.append(i[1])
        suspect.append(i[2])
        heal.append(i[3])
        dead.append(i[4])
    return jsonify({"data":[ds,confrim,suspect,heal, dead]})
Exemplo n.º 16
0
def get_l1_data():

    data = utils.get_l1_data()
    dt, confirm, suspect, heal, dead, now_confirm, now_severe = [], [], [], [], [], [], []

    for i in data[7:]:
        dt.append(i[0].strftime('%m-%d'))
        confirm.append(i[1])
        suspect.append(i[2])
        heal.append(i[3])
        dead.append(i[4])
        now_confirm.append(i[5])
        now_severe.append(i[6])

    return jsonify({
        'dt': dt,
        'confirm': confirm,
        'suspect': suspect,
        'heal': heal,
        'dead': dead,
        'now_confirm': now_confirm,
        'now_severe': now_severe,
    })