File tree Expand file tree Collapse file tree 1 file changed +28
-8
lines changed
Expand file tree Collapse file tree 1 file changed +28
-8
lines changed Original file line number Diff line number Diff line change 33"""
44import os
55import datetime as dt
6- from typing import Dict
6+ from typing import Dict , List
77
88import fastapi
99import pydantic
1010import uvicorn
1111
1212
13- class Stats (pydantic .BaseModel ):
13+ class Totals (pydantic .BaseModel ):
1414 confirmed : int
1515 deaths : int
1616 recovered : int
1717
1818
1919class Latest (pydantic .BaseModel ):
20- latest : Stats
20+ latest : Totals
21+
22+
23+ class TimelineStats (pydantic .BaseModel ):
24+ latest : int
25+ timeline : Dict [str , int ]
26+
27+
28+ class Timelines (pydantic .BaseModel ):
29+ confirmed : TimelineStats
30+ deaths : TimelineStats
31+ recovered : TimelineStats
2132
2233
2334class Country (pydantic .BaseModel ):
24- id : int
35+ coordinates : Dict = None
2536 country : str
2637 country_code : str
27- province : str = None
38+ id : int
2839 last_updated : dt .datetime = None
29- coordinates : Dict = None
30- latest : Stats = None
31- timelines : Dict = None
40+ latest : Totals = None
41+ province : str = None
42+ timelines : Timelines = None
43+
44+
45+ class AllLocations (pydantic .BaseModel ):
46+ latest : Totals
47+ locations : List [Country ]
48+
49+
50+ class Location (pydantic .BaseModel ):
51+ location : Country
3252
3353
3454APP = fastapi .FastAPI (
You can’t perform that action at this time.
0 commit comments