From 0b30aba2a8c0197ccb9528ae2318a80cfb10f457 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Thu, 26 Mar 2020 23:12:33 +0100 Subject: [PATCH 1/5] assert_equal: formatted json-strings make debugging easier --- tests/test_routes.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/test_routes.py b/tests/test_routes.py index 9e1c03ef..e9a795bd 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -12,6 +12,13 @@ from .test_jhu import DATETIME_STRING, mocked_requests_get, mocked_strptime_isoformat +def format_json(s): + return json.dumps(json.loads(s), indent=4, sort_keys=True) + +def assert_equal(ret, exp): + "Formatted json-strings make debugging easier" + assert format_json(ret) == format_json(exp) + @mock.patch("app.services.location.jhu.datetime") @mock.patch("app.services.location.jhu.requests.get", side_effect=mocked_requests_get) @@ -49,8 +56,7 @@ def test_v1_confirmed(self, mock_request_get, mock_datetime): state = "confirmed" expected_json_output = self.read_file_v1(state=state) return_data = self.client.get("/{}".format(state)).data.decode() - - assert return_data == expected_json_output + assert_equal(return_data, expected_json_output) def test_v1_deaths(self, mock_request_get, mock_datetime): mock_datetime.utcnow.return_value.isoformat.return_value = self.date @@ -58,8 +64,7 @@ def test_v1_deaths(self, mock_request_get, mock_datetime): state = "deaths" expected_json_output = self.read_file_v1(state=state) return_data = self.client.get("/{}".format(state)).data.decode() - - assert return_data == expected_json_output + assert_equal(return_data, expected_json_output) def test_v1_recovered(self, mock_request_get, mock_datetime): mock_datetime.utcnow.return_value.isoformat.return_value = self.date @@ -67,8 +72,7 @@ def test_v1_recovered(self, mock_request_get, mock_datetime): state = "recovered" expected_json_output = self.read_file_v1(state=state) return_data = self.client.get("/{}".format(state)).data.decode() - - assert return_data == expected_json_output + assert_equal(return_data, expected_json_output) def test_v1_all(self, mock_request_get, mock_datetime): mock_datetime.utcnow.return_value.isoformat.return_value = self.date @@ -77,16 +81,14 @@ def test_v1_all(self, mock_request_get, mock_datetime): expected_json_output = self.read_file_v1(state=state) return_data = self.client.get("/{}".format(state)).data.decode() # print(return_data) - assert return_data == expected_json_output + assert_equal(return_data, expected_json_output) def test_v2_latest(self, mock_request_get, mock_datetime): mock_datetime.utcnow.return_value.isoformat.return_value = DATETIME_STRING mock_datetime.strptime.side_effect = mocked_strptime_isoformat state = "latest" return_data = self.asgi_client.get(f"/v2/{state}").json() - check_dict = {"latest": {"confirmed": 1940, "deaths": 1940, "recovered": 0}} - assert return_data == check_dict def test_v2_locations(self, mock_request_get, mock_datetime): @@ -99,7 +101,7 @@ def test_v2_locations(self, mock_request_get, mock_datetime): with open(filepath, "r") as file: expected_json_output = file.read() - # assert return_data == json.loads(expected_json_output) + # assert_equal(return_data, expected_json_output) def test_v2_locations_id(self, mock_request_get, mock_datetime): mock_datetime.utcnow.return_value.isoformat.return_value = DATETIME_STRING @@ -113,7 +115,7 @@ def test_v2_locations_id(self, mock_request_get, mock_datetime): with open(filepath, "r") as file: expected_json_output = file.read() - # assert return_data == expected_json_output + # assert_equal(return_data, expected_json_output) def tearDown(self): pass From 5115702cee96d7c0bb747568c90f3152da7e05a7 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Fri, 27 Mar 2020 23:00:50 +0100 Subject: [PATCH 2/5] Readable json test files --- tests/expected_output/v1_all.json | 2010 +++++++++++++++++- tests/expected_output/v1_confirmed.json | 668 +++++- tests/expected_output/v1_deaths.json | 668 +++++- tests/expected_output/v1_recovered.json | 672 +++++- tests/expected_output/v2_locations.json | 155 +- tests/expected_output/v2_locations_id_1.json | 197 +- 6 files changed, 4364 insertions(+), 6 deletions(-) diff --git a/tests/expected_output/v1_all.json b/tests/expected_output/v1_all.json index 5ec413a0..49bd82c8 100644 --- a/tests/expected_output/v1_all.json +++ b/tests/expected_output/v1_all.json @@ -1 +1,2009 @@ -{"confirmed":{"last_updated":"2020-03-17T10:23:22.505550Z","latest":1940,"locations":[{"coordinates":{"lat":"15","long":"101"},"country":"Thailand","country_code":"TH","history":{"1/22/20":2,"1/23/20":3,"1/24/20":5,"1/25/20":7,"1/26/20":8,"1/27/20":8,"1/28/20":14,"1/29/20":14,"1/30/20":14,"1/31/20":19,"2/1/20":19,"2/10/20":32,"2/11/20":33,"2/12/20":33,"2/13/20":33,"2/14/20":33,"2/15/20":33,"2/16/20":34,"2/17/20":35,"2/18/20":35,"2/19/20":35,"2/2/20":19,"2/20/20":35,"2/21/20":35,"2/22/20":35,"2/23/20":35,"2/24/20":35,"2/25/20":37,"2/26/20":40,"2/27/20":40,"2/28/20":41,"2/29/20":42,"2/3/20":19,"2/4/20":25,"2/5/20":25,"2/6/20":25,"2/7/20":25,"2/8/20":32,"2/9/20":32,"3/1/20":42,"3/10/20":53,"3/11/20":59,"3/12/20":70,"3/13/20":75,"3/14/20":82,"3/15/20":114,"3/2/20":43,"3/3/20":43,"3/4/20":43,"3/5/20":47,"3/6/20":48,"3/7/20":50,"3/8/20":50,"3/9/20":50},"latest":114,"province":""},{"coordinates":{"lat":"36","long":"138"},"country":"Japan","country_code":"JP","history":{"1/22/20":2,"1/23/20":1,"1/24/20":2,"1/25/20":2,"1/26/20":4,"1/27/20":4,"1/28/20":7,"1/29/20":7,"1/30/20":11,"1/31/20":15,"2/1/20":20,"2/10/20":26,"2/11/20":26,"2/12/20":28,"2/13/20":28,"2/14/20":29,"2/15/20":43,"2/16/20":59,"2/17/20":66,"2/18/20":74,"2/19/20":84,"2/2/20":20,"2/20/20":94,"2/21/20":105,"2/22/20":122,"2/23/20":147,"2/24/20":159,"2/25/20":170,"2/26/20":189,"2/27/20":214,"2/28/20":228,"2/29/20":241,"2/3/20":20,"2/4/20":22,"2/5/20":22,"2/6/20":45,"2/7/20":25,"2/8/20":25,"2/9/20":26,"3/1/20":256,"3/10/20":581,"3/11/20":639,"3/12/20":639,"3/13/20":701,"3/14/20":773,"3/15/20":839,"3/2/20":274,"3/3/20":293,"3/4/20":331,"3/5/20":360,"3/6/20":420,"3/7/20":461,"3/8/20":502,"3/9/20":511},"latest":839,"province":""},{"coordinates":{"lat":"1.2833","long":"103.8333"},"country":"Singapore","country_code":"SG","history":{"1/22/20":0,"1/23/20":1,"1/24/20":3,"1/25/20":3,"1/26/20":4,"1/27/20":5,"1/28/20":7,"1/29/20":7,"1/30/20":10,"1/31/20":13,"2/1/20":16,"2/10/20":45,"2/11/20":47,"2/12/20":50,"2/13/20":58,"2/14/20":67,"2/15/20":72,"2/16/20":75,"2/17/20":77,"2/18/20":81,"2/19/20":84,"2/2/20":18,"2/20/20":84,"2/21/20":85,"2/22/20":85,"2/23/20":89,"2/24/20":89,"2/25/20":91,"2/26/20":93,"2/27/20":93,"2/28/20":93,"2/29/20":102,"2/3/20":18,"2/4/20":24,"2/5/20":28,"2/6/20":28,"2/7/20":30,"2/8/20":33,"2/9/20":40,"3/1/20":106,"3/10/20":160,"3/11/20":178,"3/12/20":178,"3/13/20":200,"3/14/20":212,"3/15/20":226,"3/2/20":108,"3/3/20":110,"3/4/20":110,"3/5/20":117,"3/6/20":130,"3/7/20":138,"3/8/20":150,"3/9/20":150},"latest":226,"province":""},{"coordinates":{"lat":"28.1667","long":"84.25"},"country":"Nepal","country_code":"NP","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":1,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":1,"3/11/20":1,"3/12/20":1,"3/13/20":1,"3/14/20":1,"3/15/20":1,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":1,"3/9/20":1},"latest":1,"province":""},{"coordinates":{"lat":"2.5","long":"112.5"},"country":"Malaysia","country_code":"MY","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":3,"1/26/20":4,"1/27/20":4,"1/28/20":4,"1/29/20":7,"1/30/20":8,"1/31/20":8,"2/1/20":8,"2/10/20":18,"2/11/20":18,"2/12/20":18,"2/13/20":19,"2/14/20":19,"2/15/20":22,"2/16/20":22,"2/17/20":22,"2/18/20":22,"2/19/20":22,"2/2/20":8,"2/20/20":22,"2/21/20":22,"2/22/20":22,"2/23/20":22,"2/24/20":22,"2/25/20":22,"2/26/20":22,"2/27/20":23,"2/28/20":23,"2/29/20":25,"2/3/20":8,"2/4/20":10,"2/5/20":12,"2/6/20":12,"2/7/20":12,"2/8/20":16,"2/9/20":16,"3/1/20":29,"3/10/20":129,"3/11/20":149,"3/12/20":149,"3/13/20":197,"3/14/20":238,"3/15/20":428,"3/2/20":29,"3/3/20":36,"3/4/20":50,"3/5/20":50,"3/6/20":83,"3/7/20":93,"3/8/20":99,"3/9/20":117},"latest":428,"province":""},{"coordinates":{"lat":"49.2827","long":"-123.1207"},"country":"Canada","country_code":"CA","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":1,"2/20/20":5,"2/21/20":6,"2/22/20":6,"2/23/20":6,"2/24/20":6,"2/25/20":7,"2/26/20":7,"2/27/20":7,"2/28/20":7,"2/29/20":8,"2/3/20":1,"2/4/20":1,"2/5/20":2,"2/6/20":2,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":8,"3/10/20":32,"3/11/20":39,"3/12/20":46,"3/13/20":64,"3/14/20":64,"3/15/20":73,"3/2/20":8,"3/3/20":9,"3/4/20":12,"3/5/20":13,"3/6/20":21,"3/7/20":21,"3/8/20":27,"3/9/20":32},"latest":73,"province":"British Columbia"},{"coordinates":{"lat":"-33.8688","long":"151.2093"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":3,"1/27/20":4,"1/28/20":4,"1/29/20":4,"1/30/20":4,"1/31/20":4,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":4,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":6,"3/10/20":55,"3/11/20":65,"3/12/20":65,"3/13/20":92,"3/14/20":112,"3/15/20":134,"3/2/20":6,"3/3/20":13,"3/4/20":22,"3/5/20":22,"3/6/20":26,"3/7/20":28,"3/8/20":38,"3/9/20":48},"latest":134,"province":"New South Wales"},{"coordinates":{"lat":"-37.8136","long":"144.9631"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":2,"1/31/20":3,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":7,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":7,"3/10/20":18,"3/11/20":21,"3/12/20":21,"3/13/20":36,"3/14/20":49,"3/15/20":57,"3/2/20":9,"3/3/20":9,"3/4/20":10,"3/5/20":10,"3/6/20":10,"3/7/20":11,"3/8/20":11,"3/9/20":15},"latest":57,"province":"Victoria"},{"coordinates":{"lat":"-28.0167","long":"153.4"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":0,"1/29/20":1,"1/30/20":3,"1/31/20":2,"2/1/20":3,"2/10/20":5,"2/11/20":5,"2/12/20":5,"2/13/20":5,"2/14/20":5,"2/15/20":5,"2/16/20":5,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":2,"2/20/20":5,"2/21/20":5,"2/22/20":5,"2/23/20":5,"2/24/20":5,"2/25/20":5,"2/26/20":5,"2/27/20":5,"2/28/20":5,"2/29/20":9,"2/3/20":2,"2/4/20":3,"2/5/20":3,"2/6/20":4,"2/7/20":5,"2/8/20":5,"2/9/20":5,"3/1/20":9,"3/10/20":18,"3/11/20":20,"3/12/20":20,"3/13/20":35,"3/14/20":46,"3/15/20":61,"3/2/20":9,"3/3/20":11,"3/4/20":11,"3/5/20":13,"3/6/20":13,"3/7/20":13,"3/8/20":15,"3/9/20":15},"latest":61,"province":"Queensland"},{"coordinates":{"lat":"11.55","long":"104.9167"},"country":"Cambodia","country_code":"KH","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":2,"3/11/20":3,"3/12/20":3,"3/13/20":5,"3/14/20":7,"3/15/20":7,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":2,"3/9/20":2},"latest":7,"province":""}],"source":"https://github.com/ExpDev07/coronavirus-tracker-api"},"deaths":{"last_updated":"2020-03-17T10:23:22.505550Z","latest":1940,"locations":[{"coordinates":{"lat":"15","long":"101"},"country":"Thailand","country_code":"TH","history":{"1/22/20":2,"1/23/20":3,"1/24/20":5,"1/25/20":7,"1/26/20":8,"1/27/20":8,"1/28/20":14,"1/29/20":14,"1/30/20":14,"1/31/20":19,"2/1/20":19,"2/10/20":32,"2/11/20":33,"2/12/20":33,"2/13/20":33,"2/14/20":33,"2/15/20":33,"2/16/20":34,"2/17/20":35,"2/18/20":35,"2/19/20":35,"2/2/20":19,"2/20/20":35,"2/21/20":35,"2/22/20":35,"2/23/20":35,"2/24/20":35,"2/25/20":37,"2/26/20":40,"2/27/20":40,"2/28/20":41,"2/29/20":42,"2/3/20":19,"2/4/20":25,"2/5/20":25,"2/6/20":25,"2/7/20":25,"2/8/20":32,"2/9/20":32,"3/1/20":42,"3/10/20":53,"3/11/20":59,"3/12/20":70,"3/13/20":75,"3/14/20":82,"3/15/20":114,"3/2/20":43,"3/3/20":43,"3/4/20":43,"3/5/20":47,"3/6/20":48,"3/7/20":50,"3/8/20":50,"3/9/20":50},"latest":114,"province":""},{"coordinates":{"lat":"36","long":"138"},"country":"Japan","country_code":"JP","history":{"1/22/20":2,"1/23/20":1,"1/24/20":2,"1/25/20":2,"1/26/20":4,"1/27/20":4,"1/28/20":7,"1/29/20":7,"1/30/20":11,"1/31/20":15,"2/1/20":20,"2/10/20":26,"2/11/20":26,"2/12/20":28,"2/13/20":28,"2/14/20":29,"2/15/20":43,"2/16/20":59,"2/17/20":66,"2/18/20":74,"2/19/20":84,"2/2/20":20,"2/20/20":94,"2/21/20":105,"2/22/20":122,"2/23/20":147,"2/24/20":159,"2/25/20":170,"2/26/20":189,"2/27/20":214,"2/28/20":228,"2/29/20":241,"2/3/20":20,"2/4/20":22,"2/5/20":22,"2/6/20":45,"2/7/20":25,"2/8/20":25,"2/9/20":26,"3/1/20":256,"3/10/20":581,"3/11/20":639,"3/12/20":639,"3/13/20":701,"3/14/20":773,"3/15/20":839,"3/2/20":274,"3/3/20":293,"3/4/20":331,"3/5/20":360,"3/6/20":420,"3/7/20":461,"3/8/20":502,"3/9/20":511},"latest":839,"province":""},{"coordinates":{"lat":"1.2833","long":"103.8333"},"country":"Singapore","country_code":"SG","history":{"1/22/20":0,"1/23/20":1,"1/24/20":3,"1/25/20":3,"1/26/20":4,"1/27/20":5,"1/28/20":7,"1/29/20":7,"1/30/20":10,"1/31/20":13,"2/1/20":16,"2/10/20":45,"2/11/20":47,"2/12/20":50,"2/13/20":58,"2/14/20":67,"2/15/20":72,"2/16/20":75,"2/17/20":77,"2/18/20":81,"2/19/20":84,"2/2/20":18,"2/20/20":84,"2/21/20":85,"2/22/20":85,"2/23/20":89,"2/24/20":89,"2/25/20":91,"2/26/20":93,"2/27/20":93,"2/28/20":93,"2/29/20":102,"2/3/20":18,"2/4/20":24,"2/5/20":28,"2/6/20":28,"2/7/20":30,"2/8/20":33,"2/9/20":40,"3/1/20":106,"3/10/20":160,"3/11/20":178,"3/12/20":178,"3/13/20":200,"3/14/20":212,"3/15/20":226,"3/2/20":108,"3/3/20":110,"3/4/20":110,"3/5/20":117,"3/6/20":130,"3/7/20":138,"3/8/20":150,"3/9/20":150},"latest":226,"province":""},{"coordinates":{"lat":"28.1667","long":"84.25"},"country":"Nepal","country_code":"NP","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":1,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":1,"3/11/20":1,"3/12/20":1,"3/13/20":1,"3/14/20":1,"3/15/20":1,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":1,"3/9/20":1},"latest":1,"province":""},{"coordinates":{"lat":"2.5","long":"112.5"},"country":"Malaysia","country_code":"MY","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":3,"1/26/20":4,"1/27/20":4,"1/28/20":4,"1/29/20":7,"1/30/20":8,"1/31/20":8,"2/1/20":8,"2/10/20":18,"2/11/20":18,"2/12/20":18,"2/13/20":19,"2/14/20":19,"2/15/20":22,"2/16/20":22,"2/17/20":22,"2/18/20":22,"2/19/20":22,"2/2/20":8,"2/20/20":22,"2/21/20":22,"2/22/20":22,"2/23/20":22,"2/24/20":22,"2/25/20":22,"2/26/20":22,"2/27/20":23,"2/28/20":23,"2/29/20":25,"2/3/20":8,"2/4/20":10,"2/5/20":12,"2/6/20":12,"2/7/20":12,"2/8/20":16,"2/9/20":16,"3/1/20":29,"3/10/20":129,"3/11/20":149,"3/12/20":149,"3/13/20":197,"3/14/20":238,"3/15/20":428,"3/2/20":29,"3/3/20":36,"3/4/20":50,"3/5/20":50,"3/6/20":83,"3/7/20":93,"3/8/20":99,"3/9/20":117},"latest":428,"province":""},{"coordinates":{"lat":"49.2827","long":"-123.1207"},"country":"Canada","country_code":"CA","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":1,"2/20/20":5,"2/21/20":6,"2/22/20":6,"2/23/20":6,"2/24/20":6,"2/25/20":7,"2/26/20":7,"2/27/20":7,"2/28/20":7,"2/29/20":8,"2/3/20":1,"2/4/20":1,"2/5/20":2,"2/6/20":2,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":8,"3/10/20":32,"3/11/20":39,"3/12/20":46,"3/13/20":64,"3/14/20":64,"3/15/20":73,"3/2/20":8,"3/3/20":9,"3/4/20":12,"3/5/20":13,"3/6/20":21,"3/7/20":21,"3/8/20":27,"3/9/20":32},"latest":73,"province":"British Columbia"},{"coordinates":{"lat":"-33.8688","long":"151.2093"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":3,"1/27/20":4,"1/28/20":4,"1/29/20":4,"1/30/20":4,"1/31/20":4,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":4,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":6,"3/10/20":55,"3/11/20":65,"3/12/20":65,"3/13/20":92,"3/14/20":112,"3/15/20":134,"3/2/20":6,"3/3/20":13,"3/4/20":22,"3/5/20":22,"3/6/20":26,"3/7/20":28,"3/8/20":38,"3/9/20":48},"latest":134,"province":"New South Wales"},{"coordinates":{"lat":"-37.8136","long":"144.9631"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":2,"1/31/20":3,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":7,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":7,"3/10/20":18,"3/11/20":21,"3/12/20":21,"3/13/20":36,"3/14/20":49,"3/15/20":57,"3/2/20":9,"3/3/20":9,"3/4/20":10,"3/5/20":10,"3/6/20":10,"3/7/20":11,"3/8/20":11,"3/9/20":15},"latest":57,"province":"Victoria"},{"coordinates":{"lat":"-28.0167","long":"153.4"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":0,"1/29/20":1,"1/30/20":3,"1/31/20":2,"2/1/20":3,"2/10/20":5,"2/11/20":5,"2/12/20":5,"2/13/20":5,"2/14/20":5,"2/15/20":5,"2/16/20":5,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":2,"2/20/20":5,"2/21/20":5,"2/22/20":5,"2/23/20":5,"2/24/20":5,"2/25/20":5,"2/26/20":5,"2/27/20":5,"2/28/20":5,"2/29/20":9,"2/3/20":2,"2/4/20":3,"2/5/20":3,"2/6/20":4,"2/7/20":5,"2/8/20":5,"2/9/20":5,"3/1/20":9,"3/10/20":18,"3/11/20":20,"3/12/20":20,"3/13/20":35,"3/14/20":46,"3/15/20":61,"3/2/20":9,"3/3/20":11,"3/4/20":11,"3/5/20":13,"3/6/20":13,"3/7/20":13,"3/8/20":15,"3/9/20":15},"latest":61,"province":"Queensland"},{"coordinates":{"lat":"11.55","long":"104.9167"},"country":"Cambodia","country_code":"KH","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":2,"3/11/20":3,"3/12/20":3,"3/13/20":5,"3/14/20":7,"3/15/20":7,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":2,"3/9/20":2},"latest":7,"province":""}],"source":"https://github.com/ExpDev07/coronavirus-tracker-api"},"latest":{"confirmed":1940,"deaths":1940,"recovered":1940},"recovered":{"last_updated":"2020-03-17T10:23:22.505550Z","latest":1940,"locations":[{"coordinates":{"lat":"15","long":"101"},"country":"Thailand","country_code":"TH","history":{"1/22/20":2,"1/23/20":3,"1/24/20":5,"1/25/20":7,"1/26/20":8,"1/27/20":8,"1/28/20":14,"1/29/20":14,"1/30/20":14,"1/31/20":19,"2/1/20":19,"2/10/20":32,"2/11/20":33,"2/12/20":33,"2/13/20":33,"2/14/20":33,"2/15/20":33,"2/16/20":34,"2/17/20":35,"2/18/20":35,"2/19/20":35,"2/2/20":19,"2/20/20":35,"2/21/20":35,"2/22/20":35,"2/23/20":35,"2/24/20":35,"2/25/20":37,"2/26/20":40,"2/27/20":40,"2/28/20":41,"2/29/20":42,"2/3/20":19,"2/4/20":25,"2/5/20":25,"2/6/20":25,"2/7/20":25,"2/8/20":32,"2/9/20":32,"3/1/20":42,"3/10/20":53,"3/11/20":59,"3/12/20":70,"3/13/20":75,"3/14/20":82,"3/15/20":114,"3/2/20":43,"3/3/20":43,"3/4/20":43,"3/5/20":47,"3/6/20":48,"3/7/20":50,"3/8/20":50,"3/9/20":50},"latest":114,"province":""},{"coordinates":{"lat":"36","long":"138"},"country":"Japan","country_code":"JP","history":{"1/22/20":2,"1/23/20":1,"1/24/20":2,"1/25/20":2,"1/26/20":4,"1/27/20":4,"1/28/20":7,"1/29/20":7,"1/30/20":11,"1/31/20":15,"2/1/20":20,"2/10/20":26,"2/11/20":26,"2/12/20":28,"2/13/20":28,"2/14/20":29,"2/15/20":43,"2/16/20":59,"2/17/20":66,"2/18/20":74,"2/19/20":84,"2/2/20":20,"2/20/20":94,"2/21/20":105,"2/22/20":122,"2/23/20":147,"2/24/20":159,"2/25/20":170,"2/26/20":189,"2/27/20":214,"2/28/20":228,"2/29/20":241,"2/3/20":20,"2/4/20":22,"2/5/20":22,"2/6/20":45,"2/7/20":25,"2/8/20":25,"2/9/20":26,"3/1/20":256,"3/10/20":581,"3/11/20":639,"3/12/20":639,"3/13/20":701,"3/14/20":773,"3/15/20":839,"3/2/20":274,"3/3/20":293,"3/4/20":331,"3/5/20":360,"3/6/20":420,"3/7/20":461,"3/8/20":502,"3/9/20":511},"latest":839,"province":""},{"coordinates":{"lat":"1.2833","long":"103.8333"},"country":"Singapore","country_code":"SG","history":{"1/22/20":0,"1/23/20":1,"1/24/20":3,"1/25/20":3,"1/26/20":4,"1/27/20":5,"1/28/20":7,"1/29/20":7,"1/30/20":10,"1/31/20":13,"2/1/20":16,"2/10/20":45,"2/11/20":47,"2/12/20":50,"2/13/20":58,"2/14/20":67,"2/15/20":72,"2/16/20":75,"2/17/20":77,"2/18/20":81,"2/19/20":84,"2/2/20":18,"2/20/20":84,"2/21/20":85,"2/22/20":85,"2/23/20":89,"2/24/20":89,"2/25/20":91,"2/26/20":93,"2/27/20":93,"2/28/20":93,"2/29/20":102,"2/3/20":18,"2/4/20":24,"2/5/20":28,"2/6/20":28,"2/7/20":30,"2/8/20":33,"2/9/20":40,"3/1/20":106,"3/10/20":160,"3/11/20":178,"3/12/20":178,"3/13/20":200,"3/14/20":212,"3/15/20":226,"3/2/20":108,"3/3/20":110,"3/4/20":110,"3/5/20":117,"3/6/20":130,"3/7/20":138,"3/8/20":150,"3/9/20":150},"latest":226,"province":""},{"coordinates":{"lat":"28.1667","long":"84.25"},"country":"Nepal","country_code":"NP","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":1,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":1,"3/11/20":1,"3/12/20":1,"3/13/20":1,"3/14/20":1,"3/15/20":1,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":1,"3/9/20":1},"latest":1,"province":""},{"coordinates":{"lat":"2.5","long":"112.5"},"country":"Malaysia","country_code":"MY","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":3,"1/26/20":4,"1/27/20":4,"1/28/20":4,"1/29/20":7,"1/30/20":8,"1/31/20":8,"2/1/20":8,"2/10/20":18,"2/11/20":18,"2/12/20":18,"2/13/20":19,"2/14/20":19,"2/15/20":22,"2/16/20":22,"2/17/20":22,"2/18/20":22,"2/19/20":22,"2/2/20":8,"2/20/20":22,"2/21/20":22,"2/22/20":22,"2/23/20":22,"2/24/20":22,"2/25/20":22,"2/26/20":22,"2/27/20":23,"2/28/20":23,"2/29/20":25,"2/3/20":8,"2/4/20":10,"2/5/20":12,"2/6/20":12,"2/7/20":12,"2/8/20":16,"2/9/20":16,"3/1/20":29,"3/10/20":129,"3/11/20":149,"3/12/20":149,"3/13/20":197,"3/14/20":238,"3/15/20":428,"3/2/20":29,"3/3/20":36,"3/4/20":50,"3/5/20":50,"3/6/20":83,"3/7/20":93,"3/8/20":99,"3/9/20":117},"latest":428,"province":""},{"coordinates":{"lat":"49.2827","long":"-123.1207"},"country":"Canada","country_code":"CA","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":1,"2/20/20":5,"2/21/20":6,"2/22/20":6,"2/23/20":6,"2/24/20":6,"2/25/20":7,"2/26/20":7,"2/27/20":7,"2/28/20":7,"2/29/20":8,"2/3/20":1,"2/4/20":1,"2/5/20":2,"2/6/20":2,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":8,"3/10/20":32,"3/11/20":39,"3/12/20":46,"3/13/20":64,"3/14/20":64,"3/15/20":73,"3/2/20":8,"3/3/20":9,"3/4/20":12,"3/5/20":13,"3/6/20":21,"3/7/20":21,"3/8/20":27,"3/9/20":32},"latest":73,"province":"British Columbia"},{"coordinates":{"lat":"-33.8688","long":"151.2093"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":3,"1/27/20":4,"1/28/20":4,"1/29/20":4,"1/30/20":4,"1/31/20":4,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":4,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":6,"3/10/20":55,"3/11/20":65,"3/12/20":65,"3/13/20":92,"3/14/20":112,"3/15/20":134,"3/2/20":6,"3/3/20":13,"3/4/20":22,"3/5/20":22,"3/6/20":26,"3/7/20":28,"3/8/20":38,"3/9/20":48},"latest":134,"province":"New South Wales"},{"coordinates":{"lat":"-37.8136","long":"144.9631"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":2,"1/31/20":3,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":7,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":7,"3/10/20":18,"3/11/20":21,"3/12/20":21,"3/13/20":36,"3/14/20":49,"3/15/20":57,"3/2/20":9,"3/3/20":9,"3/4/20":10,"3/5/20":10,"3/6/20":10,"3/7/20":11,"3/8/20":11,"3/9/20":15},"latest":57,"province":"Victoria"},{"coordinates":{"lat":"-28.0167","long":"153.4"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":0,"1/29/20":1,"1/30/20":3,"1/31/20":2,"2/1/20":3,"2/10/20":5,"2/11/20":5,"2/12/20":5,"2/13/20":5,"2/14/20":5,"2/15/20":5,"2/16/20":5,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":2,"2/20/20":5,"2/21/20":5,"2/22/20":5,"2/23/20":5,"2/24/20":5,"2/25/20":5,"2/26/20":5,"2/27/20":5,"2/28/20":5,"2/29/20":9,"2/3/20":2,"2/4/20":3,"2/5/20":3,"2/6/20":4,"2/7/20":5,"2/8/20":5,"2/9/20":5,"3/1/20":9,"3/10/20":18,"3/11/20":20,"3/12/20":20,"3/13/20":35,"3/14/20":46,"3/15/20":61,"3/2/20":9,"3/3/20":11,"3/4/20":11,"3/5/20":13,"3/6/20":13,"3/7/20":13,"3/8/20":15,"3/9/20":15},"latest":61,"province":"Queensland"},{"coordinates":{"lat":"11.55","long":"104.9167"},"country":"Cambodia","country_code":"KH","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":2,"3/11/20":3,"3/12/20":3,"3/13/20":5,"3/14/20":7,"3/15/20":7,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":2,"3/9/20":2},"latest":7,"province":""}],"source":"https://github.com/ExpDev07/coronavirus-tracker-api"}} +{ + "confirmed":{ + "last_updated":"2020-03-17T10:23:22.505550Z", + "latest":1940, + "locations":[ + { + "coordinates":{ + "lat":"15", + "long":"101" + }, + "country":"Thailand", + "country_code":"TH", + "history":{ + "1/22/20":2, + "1/23/20":3, + "1/24/20":5, + "1/25/20":7, + "1/26/20":8, + "1/27/20":8, + "1/28/20":14, + "1/29/20":14, + "1/30/20":14, + "1/31/20":19, + "2/1/20":19, + "2/10/20":32, + "2/11/20":33, + "2/12/20":33, + "2/13/20":33, + "2/14/20":33, + "2/15/20":33, + "2/16/20":34, + "2/17/20":35, + "2/18/20":35, + "2/19/20":35, + "2/2/20":19, + "2/20/20":35, + "2/21/20":35, + "2/22/20":35, + "2/23/20":35, + "2/24/20":35, + "2/25/20":37, + "2/26/20":40, + "2/27/20":40, + "2/28/20":41, + "2/29/20":42, + "2/3/20":19, + "2/4/20":25, + "2/5/20":25, + "2/6/20":25, + "2/7/20":25, + "2/8/20":32, + "2/9/20":32, + "3/1/20":42, + "3/10/20":53, + "3/11/20":59, + "3/12/20":70, + "3/13/20":75, + "3/14/20":82, + "3/15/20":114, + "3/2/20":43, + "3/3/20":43, + "3/4/20":43, + "3/5/20":47, + "3/6/20":48, + "3/7/20":50, + "3/8/20":50, + "3/9/20":50 + }, + "latest":114, + "province":"" + }, + { + "coordinates":{ + "lat":"36", + "long":"138" + }, + "country":"Japan", + "country_code":"JP", + "history":{ + "1/22/20":2, + "1/23/20":1, + "1/24/20":2, + "1/25/20":2, + "1/26/20":4, + "1/27/20":4, + "1/28/20":7, + "1/29/20":7, + "1/30/20":11, + "1/31/20":15, + "2/1/20":20, + "2/10/20":26, + "2/11/20":26, + "2/12/20":28, + "2/13/20":28, + "2/14/20":29, + "2/15/20":43, + "2/16/20":59, + "2/17/20":66, + "2/18/20":74, + "2/19/20":84, + "2/2/20":20, + "2/20/20":94, + "2/21/20":105, + "2/22/20":122, + "2/23/20":147, + "2/24/20":159, + "2/25/20":170, + "2/26/20":189, + "2/27/20":214, + "2/28/20":228, + "2/29/20":241, + "2/3/20":20, + "2/4/20":22, + "2/5/20":22, + "2/6/20":45, + "2/7/20":25, + "2/8/20":25, + "2/9/20":26, + "3/1/20":256, + "3/10/20":581, + "3/11/20":639, + "3/12/20":639, + "3/13/20":701, + "3/14/20":773, + "3/15/20":839, + "3/2/20":274, + "3/3/20":293, + "3/4/20":331, + "3/5/20":360, + "3/6/20":420, + "3/7/20":461, + "3/8/20":502, + "3/9/20":511 + }, + "latest":839, + "province":"" + }, + { + "coordinates":{ + "lat":"1.2833", + "long":"103.8333" + }, + "country":"Singapore", + "country_code":"SG", + "history":{ + "1/22/20":0, + "1/23/20":1, + "1/24/20":3, + "1/25/20":3, + "1/26/20":4, + "1/27/20":5, + "1/28/20":7, + "1/29/20":7, + "1/30/20":10, + "1/31/20":13, + "2/1/20":16, + "2/10/20":45, + "2/11/20":47, + "2/12/20":50, + "2/13/20":58, + "2/14/20":67, + "2/15/20":72, + "2/16/20":75, + "2/17/20":77, + "2/18/20":81, + "2/19/20":84, + "2/2/20":18, + "2/20/20":84, + "2/21/20":85, + "2/22/20":85, + "2/23/20":89, + "2/24/20":89, + "2/25/20":91, + "2/26/20":93, + "2/27/20":93, + "2/28/20":93, + "2/29/20":102, + "2/3/20":18, + "2/4/20":24, + "2/5/20":28, + "2/6/20":28, + "2/7/20":30, + "2/8/20":33, + "2/9/20":40, + "3/1/20":106, + "3/10/20":160, + "3/11/20":178, + "3/12/20":178, + "3/13/20":200, + "3/14/20":212, + "3/15/20":226, + "3/2/20":108, + "3/3/20":110, + "3/4/20":110, + "3/5/20":117, + "3/6/20":130, + "3/7/20":138, + "3/8/20":150, + "3/9/20":150 + }, + "latest":226, + "province":"" + }, + { + "coordinates":{ + "lat":"28.1667", + "long":"84.25" + }, + "country":"Nepal", + "country_code":"NP", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":1, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":1, + "3/11/20":1, + "3/12/20":1, + "3/13/20":1, + "3/14/20":1, + "3/15/20":1, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":1, + "3/9/20":1 + }, + "latest":1, + "province":"" + }, + { + "coordinates":{ + "lat":"2.5", + "long":"112.5" + }, + "country":"Malaysia", + "country_code":"MY", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":3, + "1/26/20":4, + "1/27/20":4, + "1/28/20":4, + "1/29/20":7, + "1/30/20":8, + "1/31/20":8, + "2/1/20":8, + "2/10/20":18, + "2/11/20":18, + "2/12/20":18, + "2/13/20":19, + "2/14/20":19, + "2/15/20":22, + "2/16/20":22, + "2/17/20":22, + "2/18/20":22, + "2/19/20":22, + "2/2/20":8, + "2/20/20":22, + "2/21/20":22, + "2/22/20":22, + "2/23/20":22, + "2/24/20":22, + "2/25/20":22, + "2/26/20":22, + "2/27/20":23, + "2/28/20":23, + "2/29/20":25, + "2/3/20":8, + "2/4/20":10, + "2/5/20":12, + "2/6/20":12, + "2/7/20":12, + "2/8/20":16, + "2/9/20":16, + "3/1/20":29, + "3/10/20":129, + "3/11/20":149, + "3/12/20":149, + "3/13/20":197, + "3/14/20":238, + "3/15/20":428, + "3/2/20":29, + "3/3/20":36, + "3/4/20":50, + "3/5/20":50, + "3/6/20":83, + "3/7/20":93, + "3/8/20":99, + "3/9/20":117 + }, + "latest":428, + "province":"" + }, + { + "coordinates":{ + "lat":"49.2827", + "long":"-123.1207" + }, + "country":"Canada", + "country_code":"CA", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":1, + "2/20/20":5, + "2/21/20":6, + "2/22/20":6, + "2/23/20":6, + "2/24/20":6, + "2/25/20":7, + "2/26/20":7, + "2/27/20":7, + "2/28/20":7, + "2/29/20":8, + "2/3/20":1, + "2/4/20":1, + "2/5/20":2, + "2/6/20":2, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":8, + "3/10/20":32, + "3/11/20":39, + "3/12/20":46, + "3/13/20":64, + "3/14/20":64, + "3/15/20":73, + "3/2/20":8, + "3/3/20":9, + "3/4/20":12, + "3/5/20":13, + "3/6/20":21, + "3/7/20":21, + "3/8/20":27, + "3/9/20":32 + }, + "latest":73, + "province":"British Columbia" + }, + { + "coordinates":{ + "lat":"-33.8688", + "long":"151.2093" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":3, + "1/27/20":4, + "1/28/20":4, + "1/29/20":4, + "1/30/20":4, + "1/31/20":4, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":4, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":6, + "3/10/20":55, + "3/11/20":65, + "3/12/20":65, + "3/13/20":92, + "3/14/20":112, + "3/15/20":134, + "3/2/20":6, + "3/3/20":13, + "3/4/20":22, + "3/5/20":22, + "3/6/20":26, + "3/7/20":28, + "3/8/20":38, + "3/9/20":48 + }, + "latest":134, + "province":"New South Wales" + }, + { + "coordinates":{ + "lat":"-37.8136", + "long":"144.9631" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":2, + "1/31/20":3, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":7, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":7, + "3/10/20":18, + "3/11/20":21, + "3/12/20":21, + "3/13/20":36, + "3/14/20":49, + "3/15/20":57, + "3/2/20":9, + "3/3/20":9, + "3/4/20":10, + "3/5/20":10, + "3/6/20":10, + "3/7/20":11, + "3/8/20":11, + "3/9/20":15 + }, + "latest":57, + "province":"Victoria" + }, + { + "coordinates":{ + "lat":"-28.0167", + "long":"153.4" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":0, + "1/29/20":1, + "1/30/20":3, + "1/31/20":2, + "2/1/20":3, + "2/10/20":5, + "2/11/20":5, + "2/12/20":5, + "2/13/20":5, + "2/14/20":5, + "2/15/20":5, + "2/16/20":5, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":2, + "2/20/20":5, + "2/21/20":5, + "2/22/20":5, + "2/23/20":5, + "2/24/20":5, + "2/25/20":5, + "2/26/20":5, + "2/27/20":5, + "2/28/20":5, + "2/29/20":9, + "2/3/20":2, + "2/4/20":3, + "2/5/20":3, + "2/6/20":4, + "2/7/20":5, + "2/8/20":5, + "2/9/20":5, + "3/1/20":9, + "3/10/20":18, + "3/11/20":20, + "3/12/20":20, + "3/13/20":35, + "3/14/20":46, + "3/15/20":61, + "3/2/20":9, + "3/3/20":11, + "3/4/20":11, + "3/5/20":13, + "3/6/20":13, + "3/7/20":13, + "3/8/20":15, + "3/9/20":15 + }, + "latest":61, + "province":"Queensland" + }, + { + "coordinates":{ + "lat":"11.55", + "long":"104.9167" + }, + "country":"Cambodia", + "country_code":"KH", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":2, + "3/11/20":3, + "3/12/20":3, + "3/13/20":5, + "3/14/20":7, + "3/15/20":7, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":2, + "3/9/20":2 + }, + "latest":7, + "province":"" + } + ], + "source":"https://github.com/ExpDev07/coronavirus-tracker-api" + }, + "deaths":{ + "last_updated":"2020-03-17T10:23:22.505550Z", + "latest":1940, + "locations":[ + { + "coordinates":{ + "lat":"15", + "long":"101" + }, + "country":"Thailand", + "country_code":"TH", + "history":{ + "1/22/20":2, + "1/23/20":3, + "1/24/20":5, + "1/25/20":7, + "1/26/20":8, + "1/27/20":8, + "1/28/20":14, + "1/29/20":14, + "1/30/20":14, + "1/31/20":19, + "2/1/20":19, + "2/10/20":32, + "2/11/20":33, + "2/12/20":33, + "2/13/20":33, + "2/14/20":33, + "2/15/20":33, + "2/16/20":34, + "2/17/20":35, + "2/18/20":35, + "2/19/20":35, + "2/2/20":19, + "2/20/20":35, + "2/21/20":35, + "2/22/20":35, + "2/23/20":35, + "2/24/20":35, + "2/25/20":37, + "2/26/20":40, + "2/27/20":40, + "2/28/20":41, + "2/29/20":42, + "2/3/20":19, + "2/4/20":25, + "2/5/20":25, + "2/6/20":25, + "2/7/20":25, + "2/8/20":32, + "2/9/20":32, + "3/1/20":42, + "3/10/20":53, + "3/11/20":59, + "3/12/20":70, + "3/13/20":75, + "3/14/20":82, + "3/15/20":114, + "3/2/20":43, + "3/3/20":43, + "3/4/20":43, + "3/5/20":47, + "3/6/20":48, + "3/7/20":50, + "3/8/20":50, + "3/9/20":50 + }, + "latest":114, + "province":"" + }, + { + "coordinates":{ + "lat":"36", + "long":"138" + }, + "country":"Japan", + "country_code":"JP", + "history":{ + "1/22/20":2, + "1/23/20":1, + "1/24/20":2, + "1/25/20":2, + "1/26/20":4, + "1/27/20":4, + "1/28/20":7, + "1/29/20":7, + "1/30/20":11, + "1/31/20":15, + "2/1/20":20, + "2/10/20":26, + "2/11/20":26, + "2/12/20":28, + "2/13/20":28, + "2/14/20":29, + "2/15/20":43, + "2/16/20":59, + "2/17/20":66, + "2/18/20":74, + "2/19/20":84, + "2/2/20":20, + "2/20/20":94, + "2/21/20":105, + "2/22/20":122, + "2/23/20":147, + "2/24/20":159, + "2/25/20":170, + "2/26/20":189, + "2/27/20":214, + "2/28/20":228, + "2/29/20":241, + "2/3/20":20, + "2/4/20":22, + "2/5/20":22, + "2/6/20":45, + "2/7/20":25, + "2/8/20":25, + "2/9/20":26, + "3/1/20":256, + "3/10/20":581, + "3/11/20":639, + "3/12/20":639, + "3/13/20":701, + "3/14/20":773, + "3/15/20":839, + "3/2/20":274, + "3/3/20":293, + "3/4/20":331, + "3/5/20":360, + "3/6/20":420, + "3/7/20":461, + "3/8/20":502, + "3/9/20":511 + }, + "latest":839, + "province":"" + }, + { + "coordinates":{ + "lat":"1.2833", + "long":"103.8333" + }, + "country":"Singapore", + "country_code":"SG", + "history":{ + "1/22/20":0, + "1/23/20":1, + "1/24/20":3, + "1/25/20":3, + "1/26/20":4, + "1/27/20":5, + "1/28/20":7, + "1/29/20":7, + "1/30/20":10, + "1/31/20":13, + "2/1/20":16, + "2/10/20":45, + "2/11/20":47, + "2/12/20":50, + "2/13/20":58, + "2/14/20":67, + "2/15/20":72, + "2/16/20":75, + "2/17/20":77, + "2/18/20":81, + "2/19/20":84, + "2/2/20":18, + "2/20/20":84, + "2/21/20":85, + "2/22/20":85, + "2/23/20":89, + "2/24/20":89, + "2/25/20":91, + "2/26/20":93, + "2/27/20":93, + "2/28/20":93, + "2/29/20":102, + "2/3/20":18, + "2/4/20":24, + "2/5/20":28, + "2/6/20":28, + "2/7/20":30, + "2/8/20":33, + "2/9/20":40, + "3/1/20":106, + "3/10/20":160, + "3/11/20":178, + "3/12/20":178, + "3/13/20":200, + "3/14/20":212, + "3/15/20":226, + "3/2/20":108, + "3/3/20":110, + "3/4/20":110, + "3/5/20":117, + "3/6/20":130, + "3/7/20":138, + "3/8/20":150, + "3/9/20":150 + }, + "latest":226, + "province":"" + }, + { + "coordinates":{ + "lat":"28.1667", + "long":"84.25" + }, + "country":"Nepal", + "country_code":"NP", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":1, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":1, + "3/11/20":1, + "3/12/20":1, + "3/13/20":1, + "3/14/20":1, + "3/15/20":1, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":1, + "3/9/20":1 + }, + "latest":1, + "province":"" + }, + { + "coordinates":{ + "lat":"2.5", + "long":"112.5" + }, + "country":"Malaysia", + "country_code":"MY", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":3, + "1/26/20":4, + "1/27/20":4, + "1/28/20":4, + "1/29/20":7, + "1/30/20":8, + "1/31/20":8, + "2/1/20":8, + "2/10/20":18, + "2/11/20":18, + "2/12/20":18, + "2/13/20":19, + "2/14/20":19, + "2/15/20":22, + "2/16/20":22, + "2/17/20":22, + "2/18/20":22, + "2/19/20":22, + "2/2/20":8, + "2/20/20":22, + "2/21/20":22, + "2/22/20":22, + "2/23/20":22, + "2/24/20":22, + "2/25/20":22, + "2/26/20":22, + "2/27/20":23, + "2/28/20":23, + "2/29/20":25, + "2/3/20":8, + "2/4/20":10, + "2/5/20":12, + "2/6/20":12, + "2/7/20":12, + "2/8/20":16, + "2/9/20":16, + "3/1/20":29, + "3/10/20":129, + "3/11/20":149, + "3/12/20":149, + "3/13/20":197, + "3/14/20":238, + "3/15/20":428, + "3/2/20":29, + "3/3/20":36, + "3/4/20":50, + "3/5/20":50, + "3/6/20":83, + "3/7/20":93, + "3/8/20":99, + "3/9/20":117 + }, + "latest":428, + "province":"" + }, + { + "coordinates":{ + "lat":"49.2827", + "long":"-123.1207" + }, + "country":"Canada", + "country_code":"CA", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":1, + "2/20/20":5, + "2/21/20":6, + "2/22/20":6, + "2/23/20":6, + "2/24/20":6, + "2/25/20":7, + "2/26/20":7, + "2/27/20":7, + "2/28/20":7, + "2/29/20":8, + "2/3/20":1, + "2/4/20":1, + "2/5/20":2, + "2/6/20":2, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":8, + "3/10/20":32, + "3/11/20":39, + "3/12/20":46, + "3/13/20":64, + "3/14/20":64, + "3/15/20":73, + "3/2/20":8, + "3/3/20":9, + "3/4/20":12, + "3/5/20":13, + "3/6/20":21, + "3/7/20":21, + "3/8/20":27, + "3/9/20":32 + }, + "latest":73, + "province":"British Columbia" + }, + { + "coordinates":{ + "lat":"-33.8688", + "long":"151.2093" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":3, + "1/27/20":4, + "1/28/20":4, + "1/29/20":4, + "1/30/20":4, + "1/31/20":4, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":4, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":6, + "3/10/20":55, + "3/11/20":65, + "3/12/20":65, + "3/13/20":92, + "3/14/20":112, + "3/15/20":134, + "3/2/20":6, + "3/3/20":13, + "3/4/20":22, + "3/5/20":22, + "3/6/20":26, + "3/7/20":28, + "3/8/20":38, + "3/9/20":48 + }, + "latest":134, + "province":"New South Wales" + }, + { + "coordinates":{ + "lat":"-37.8136", + "long":"144.9631" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":2, + "1/31/20":3, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":7, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":7, + "3/10/20":18, + "3/11/20":21, + "3/12/20":21, + "3/13/20":36, + "3/14/20":49, + "3/15/20":57, + "3/2/20":9, + "3/3/20":9, + "3/4/20":10, + "3/5/20":10, + "3/6/20":10, + "3/7/20":11, + "3/8/20":11, + "3/9/20":15 + }, + "latest":57, + "province":"Victoria" + }, + { + "coordinates":{ + "lat":"-28.0167", + "long":"153.4" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":0, + "1/29/20":1, + "1/30/20":3, + "1/31/20":2, + "2/1/20":3, + "2/10/20":5, + "2/11/20":5, + "2/12/20":5, + "2/13/20":5, + "2/14/20":5, + "2/15/20":5, + "2/16/20":5, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":2, + "2/20/20":5, + "2/21/20":5, + "2/22/20":5, + "2/23/20":5, + "2/24/20":5, + "2/25/20":5, + "2/26/20":5, + "2/27/20":5, + "2/28/20":5, + "2/29/20":9, + "2/3/20":2, + "2/4/20":3, + "2/5/20":3, + "2/6/20":4, + "2/7/20":5, + "2/8/20":5, + "2/9/20":5, + "3/1/20":9, + "3/10/20":18, + "3/11/20":20, + "3/12/20":20, + "3/13/20":35, + "3/14/20":46, + "3/15/20":61, + "3/2/20":9, + "3/3/20":11, + "3/4/20":11, + "3/5/20":13, + "3/6/20":13, + "3/7/20":13, + "3/8/20":15, + "3/9/20":15 + }, + "latest":61, + "province":"Queensland" + }, + { + "coordinates":{ + "lat":"11.55", + "long":"104.9167" + }, + "country":"Cambodia", + "country_code":"KH", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":2, + "3/11/20":3, + "3/12/20":3, + "3/13/20":5, + "3/14/20":7, + "3/15/20":7, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":2, + "3/9/20":2 + }, + "latest":7, + "province":"" + } + ], + "source":"https://github.com/ExpDev07/coronavirus-tracker-api" + }, + "latest":{ + "confirmed":1940, + "deaths":1940, + "recovered":1940 + }, + "recovered":{ + "last_updated":"2020-03-17T10:23:22.505550Z", + "latest":1940, + "locations":[ + { + "coordinates":{ + "lat":"15", + "long":"101" + }, + "country":"Thailand", + "country_code":"TH", + "history":{ + "1/22/20":2, + "1/23/20":3, + "1/24/20":5, + "1/25/20":7, + "1/26/20":8, + "1/27/20":8, + "1/28/20":14, + "1/29/20":14, + "1/30/20":14, + "1/31/20":19, + "2/1/20":19, + "2/10/20":32, + "2/11/20":33, + "2/12/20":33, + "2/13/20":33, + "2/14/20":33, + "2/15/20":33, + "2/16/20":34, + "2/17/20":35, + "2/18/20":35, + "2/19/20":35, + "2/2/20":19, + "2/20/20":35, + "2/21/20":35, + "2/22/20":35, + "2/23/20":35, + "2/24/20":35, + "2/25/20":37, + "2/26/20":40, + "2/27/20":40, + "2/28/20":41, + "2/29/20":42, + "2/3/20":19, + "2/4/20":25, + "2/5/20":25, + "2/6/20":25, + "2/7/20":25, + "2/8/20":32, + "2/9/20":32, + "3/1/20":42, + "3/10/20":53, + "3/11/20":59, + "3/12/20":70, + "3/13/20":75, + "3/14/20":82, + "3/15/20":114, + "3/2/20":43, + "3/3/20":43, + "3/4/20":43, + "3/5/20":47, + "3/6/20":48, + "3/7/20":50, + "3/8/20":50, + "3/9/20":50 + }, + "latest":114, + "province":"" + }, + { + "coordinates":{ + "lat":"36", + "long":"138" + }, + "country":"Japan", + "country_code":"JP", + "history":{ + "1/22/20":2, + "1/23/20":1, + "1/24/20":2, + "1/25/20":2, + "1/26/20":4, + "1/27/20":4, + "1/28/20":7, + "1/29/20":7, + "1/30/20":11, + "1/31/20":15, + "2/1/20":20, + "2/10/20":26, + "2/11/20":26, + "2/12/20":28, + "2/13/20":28, + "2/14/20":29, + "2/15/20":43, + "2/16/20":59, + "2/17/20":66, + "2/18/20":74, + "2/19/20":84, + "2/2/20":20, + "2/20/20":94, + "2/21/20":105, + "2/22/20":122, + "2/23/20":147, + "2/24/20":159, + "2/25/20":170, + "2/26/20":189, + "2/27/20":214, + "2/28/20":228, + "2/29/20":241, + "2/3/20":20, + "2/4/20":22, + "2/5/20":22, + "2/6/20":45, + "2/7/20":25, + "2/8/20":25, + "2/9/20":26, + "3/1/20":256, + "3/10/20":581, + "3/11/20":639, + "3/12/20":639, + "3/13/20":701, + "3/14/20":773, + "3/15/20":839, + "3/2/20":274, + "3/3/20":293, + "3/4/20":331, + "3/5/20":360, + "3/6/20":420, + "3/7/20":461, + "3/8/20":502, + "3/9/20":511 + }, + "latest":839, + "province":"" + }, + { + "coordinates":{ + "lat":"1.2833", + "long":"103.8333" + }, + "country":"Singapore", + "country_code":"SG", + "history":{ + "1/22/20":0, + "1/23/20":1, + "1/24/20":3, + "1/25/20":3, + "1/26/20":4, + "1/27/20":5, + "1/28/20":7, + "1/29/20":7, + "1/30/20":10, + "1/31/20":13, + "2/1/20":16, + "2/10/20":45, + "2/11/20":47, + "2/12/20":50, + "2/13/20":58, + "2/14/20":67, + "2/15/20":72, + "2/16/20":75, + "2/17/20":77, + "2/18/20":81, + "2/19/20":84, + "2/2/20":18, + "2/20/20":84, + "2/21/20":85, + "2/22/20":85, + "2/23/20":89, + "2/24/20":89, + "2/25/20":91, + "2/26/20":93, + "2/27/20":93, + "2/28/20":93, + "2/29/20":102, + "2/3/20":18, + "2/4/20":24, + "2/5/20":28, + "2/6/20":28, + "2/7/20":30, + "2/8/20":33, + "2/9/20":40, + "3/1/20":106, + "3/10/20":160, + "3/11/20":178, + "3/12/20":178, + "3/13/20":200, + "3/14/20":212, + "3/15/20":226, + "3/2/20":108, + "3/3/20":110, + "3/4/20":110, + "3/5/20":117, + "3/6/20":130, + "3/7/20":138, + "3/8/20":150, + "3/9/20":150 + }, + "latest":226, + "province":"" + }, + { + "coordinates":{ + "lat":"28.1667", + "long":"84.25" + }, + "country":"Nepal", + "country_code":"NP", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":1, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":1, + "3/11/20":1, + "3/12/20":1, + "3/13/20":1, + "3/14/20":1, + "3/15/20":1, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":1, + "3/9/20":1 + }, + "latest":1, + "province":"" + }, + { + "coordinates":{ + "lat":"2.5", + "long":"112.5" + }, + "country":"Malaysia", + "country_code":"MY", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":3, + "1/26/20":4, + "1/27/20":4, + "1/28/20":4, + "1/29/20":7, + "1/30/20":8, + "1/31/20":8, + "2/1/20":8, + "2/10/20":18, + "2/11/20":18, + "2/12/20":18, + "2/13/20":19, + "2/14/20":19, + "2/15/20":22, + "2/16/20":22, + "2/17/20":22, + "2/18/20":22, + "2/19/20":22, + "2/2/20":8, + "2/20/20":22, + "2/21/20":22, + "2/22/20":22, + "2/23/20":22, + "2/24/20":22, + "2/25/20":22, + "2/26/20":22, + "2/27/20":23, + "2/28/20":23, + "2/29/20":25, + "2/3/20":8, + "2/4/20":10, + "2/5/20":12, + "2/6/20":12, + "2/7/20":12, + "2/8/20":16, + "2/9/20":16, + "3/1/20":29, + "3/10/20":129, + "3/11/20":149, + "3/12/20":149, + "3/13/20":197, + "3/14/20":238, + "3/15/20":428, + "3/2/20":29, + "3/3/20":36, + "3/4/20":50, + "3/5/20":50, + "3/6/20":83, + "3/7/20":93, + "3/8/20":99, + "3/9/20":117 + }, + "latest":428, + "province":"" + }, + { + "coordinates":{ + "lat":"49.2827", + "long":"-123.1207" + }, + "country":"Canada", + "country_code":"CA", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":1, + "2/20/20":5, + "2/21/20":6, + "2/22/20":6, + "2/23/20":6, + "2/24/20":6, + "2/25/20":7, + "2/26/20":7, + "2/27/20":7, + "2/28/20":7, + "2/29/20":8, + "2/3/20":1, + "2/4/20":1, + "2/5/20":2, + "2/6/20":2, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":8, + "3/10/20":32, + "3/11/20":39, + "3/12/20":46, + "3/13/20":64, + "3/14/20":64, + "3/15/20":73, + "3/2/20":8, + "3/3/20":9, + "3/4/20":12, + "3/5/20":13, + "3/6/20":21, + "3/7/20":21, + "3/8/20":27, + "3/9/20":32 + }, + "latest":73, + "province":"British Columbia" + }, + { + "coordinates":{ + "lat":"-33.8688", + "long":"151.2093" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":3, + "1/27/20":4, + "1/28/20":4, + "1/29/20":4, + "1/30/20":4, + "1/31/20":4, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":4, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":6, + "3/10/20":55, + "3/11/20":65, + "3/12/20":65, + "3/13/20":92, + "3/14/20":112, + "3/15/20":134, + "3/2/20":6, + "3/3/20":13, + "3/4/20":22, + "3/5/20":22, + "3/6/20":26, + "3/7/20":28, + "3/8/20":38, + "3/9/20":48 + }, + "latest":134, + "province":"New South Wales" + }, + { + "coordinates":{ + "lat":"-37.8136", + "long":"144.9631" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":2, + "1/31/20":3, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":7, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":7, + "3/10/20":18, + "3/11/20":21, + "3/12/20":21, + "3/13/20":36, + "3/14/20":49, + "3/15/20":57, + "3/2/20":9, + "3/3/20":9, + "3/4/20":10, + "3/5/20":10, + "3/6/20":10, + "3/7/20":11, + "3/8/20":11, + "3/9/20":15 + }, + "latest":57, + "province":"Victoria" + }, + { + "coordinates":{ + "lat":"-28.0167", + "long":"153.4" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":0, + "1/29/20":1, + "1/30/20":3, + "1/31/20":2, + "2/1/20":3, + "2/10/20":5, + "2/11/20":5, + "2/12/20":5, + "2/13/20":5, + "2/14/20":5, + "2/15/20":5, + "2/16/20":5, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":2, + "2/20/20":5, + "2/21/20":5, + "2/22/20":5, + "2/23/20":5, + "2/24/20":5, + "2/25/20":5, + "2/26/20":5, + "2/27/20":5, + "2/28/20":5, + "2/29/20":9, + "2/3/20":2, + "2/4/20":3, + "2/5/20":3, + "2/6/20":4, + "2/7/20":5, + "2/8/20":5, + "2/9/20":5, + "3/1/20":9, + "3/10/20":18, + "3/11/20":20, + "3/12/20":20, + "3/13/20":35, + "3/14/20":46, + "3/15/20":61, + "3/2/20":9, + "3/3/20":11, + "3/4/20":11, + "3/5/20":13, + "3/6/20":13, + "3/7/20":13, + "3/8/20":15, + "3/9/20":15 + }, + "latest":61, + "province":"Queensland" + }, + { + "coordinates":{ + "lat":"11.55", + "long":"104.9167" + }, + "country":"Cambodia", + "country_code":"KH", + "continent_codes_list":["ASI"], + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":2, + "3/11/20":3, + "3/12/20":3, + "3/13/20":5, + "3/14/20":7, + "3/15/20":7, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":2, + "3/9/20":2 + }, + "latest":7, + "province":"" + } + ], + "source":"https://github.com/ExpDev07/coronavirus-tracker-api" + } +} diff --git a/tests/expected_output/v1_confirmed.json b/tests/expected_output/v1_confirmed.json index 48dc9cc2..6dc57d57 100644 --- a/tests/expected_output/v1_confirmed.json +++ b/tests/expected_output/v1_confirmed.json @@ -1 +1,667 @@ -{"last_updated":"2020-03-17T10:23:22.505550Z","latest":1940,"locations":[{"coordinates":{"lat":"15","long":"101"},"country":"Thailand","country_code":"TH","history":{"1/22/20":2,"1/23/20":3,"1/24/20":5,"1/25/20":7,"1/26/20":8,"1/27/20":8,"1/28/20":14,"1/29/20":14,"1/30/20":14,"1/31/20":19,"2/1/20":19,"2/10/20":32,"2/11/20":33,"2/12/20":33,"2/13/20":33,"2/14/20":33,"2/15/20":33,"2/16/20":34,"2/17/20":35,"2/18/20":35,"2/19/20":35,"2/2/20":19,"2/20/20":35,"2/21/20":35,"2/22/20":35,"2/23/20":35,"2/24/20":35,"2/25/20":37,"2/26/20":40,"2/27/20":40,"2/28/20":41,"2/29/20":42,"2/3/20":19,"2/4/20":25,"2/5/20":25,"2/6/20":25,"2/7/20":25,"2/8/20":32,"2/9/20":32,"3/1/20":42,"3/10/20":53,"3/11/20":59,"3/12/20":70,"3/13/20":75,"3/14/20":82,"3/15/20":114,"3/2/20":43,"3/3/20":43,"3/4/20":43,"3/5/20":47,"3/6/20":48,"3/7/20":50,"3/8/20":50,"3/9/20":50},"latest":114,"province":""},{"coordinates":{"lat":"36","long":"138"},"country":"Japan","country_code":"JP","history":{"1/22/20":2,"1/23/20":1,"1/24/20":2,"1/25/20":2,"1/26/20":4,"1/27/20":4,"1/28/20":7,"1/29/20":7,"1/30/20":11,"1/31/20":15,"2/1/20":20,"2/10/20":26,"2/11/20":26,"2/12/20":28,"2/13/20":28,"2/14/20":29,"2/15/20":43,"2/16/20":59,"2/17/20":66,"2/18/20":74,"2/19/20":84,"2/2/20":20,"2/20/20":94,"2/21/20":105,"2/22/20":122,"2/23/20":147,"2/24/20":159,"2/25/20":170,"2/26/20":189,"2/27/20":214,"2/28/20":228,"2/29/20":241,"2/3/20":20,"2/4/20":22,"2/5/20":22,"2/6/20":45,"2/7/20":25,"2/8/20":25,"2/9/20":26,"3/1/20":256,"3/10/20":581,"3/11/20":639,"3/12/20":639,"3/13/20":701,"3/14/20":773,"3/15/20":839,"3/2/20":274,"3/3/20":293,"3/4/20":331,"3/5/20":360,"3/6/20":420,"3/7/20":461,"3/8/20":502,"3/9/20":511},"latest":839,"province":""},{"coordinates":{"lat":"1.2833","long":"103.8333"},"country":"Singapore","country_code":"SG","history":{"1/22/20":0,"1/23/20":1,"1/24/20":3,"1/25/20":3,"1/26/20":4,"1/27/20":5,"1/28/20":7,"1/29/20":7,"1/30/20":10,"1/31/20":13,"2/1/20":16,"2/10/20":45,"2/11/20":47,"2/12/20":50,"2/13/20":58,"2/14/20":67,"2/15/20":72,"2/16/20":75,"2/17/20":77,"2/18/20":81,"2/19/20":84,"2/2/20":18,"2/20/20":84,"2/21/20":85,"2/22/20":85,"2/23/20":89,"2/24/20":89,"2/25/20":91,"2/26/20":93,"2/27/20":93,"2/28/20":93,"2/29/20":102,"2/3/20":18,"2/4/20":24,"2/5/20":28,"2/6/20":28,"2/7/20":30,"2/8/20":33,"2/9/20":40,"3/1/20":106,"3/10/20":160,"3/11/20":178,"3/12/20":178,"3/13/20":200,"3/14/20":212,"3/15/20":226,"3/2/20":108,"3/3/20":110,"3/4/20":110,"3/5/20":117,"3/6/20":130,"3/7/20":138,"3/8/20":150,"3/9/20":150},"latest":226,"province":""},{"coordinates":{"lat":"28.1667","long":"84.25"},"country":"Nepal","country_code":"NP","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":1,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":1,"3/11/20":1,"3/12/20":1,"3/13/20":1,"3/14/20":1,"3/15/20":1,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":1,"3/9/20":1},"latest":1,"province":""},{"coordinates":{"lat":"2.5","long":"112.5"},"country":"Malaysia","country_code":"MY","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":3,"1/26/20":4,"1/27/20":4,"1/28/20":4,"1/29/20":7,"1/30/20":8,"1/31/20":8,"2/1/20":8,"2/10/20":18,"2/11/20":18,"2/12/20":18,"2/13/20":19,"2/14/20":19,"2/15/20":22,"2/16/20":22,"2/17/20":22,"2/18/20":22,"2/19/20":22,"2/2/20":8,"2/20/20":22,"2/21/20":22,"2/22/20":22,"2/23/20":22,"2/24/20":22,"2/25/20":22,"2/26/20":22,"2/27/20":23,"2/28/20":23,"2/29/20":25,"2/3/20":8,"2/4/20":10,"2/5/20":12,"2/6/20":12,"2/7/20":12,"2/8/20":16,"2/9/20":16,"3/1/20":29,"3/10/20":129,"3/11/20":149,"3/12/20":149,"3/13/20":197,"3/14/20":238,"3/15/20":428,"3/2/20":29,"3/3/20":36,"3/4/20":50,"3/5/20":50,"3/6/20":83,"3/7/20":93,"3/8/20":99,"3/9/20":117},"latest":428,"province":""},{"coordinates":{"lat":"49.2827","long":"-123.1207"},"country":"Canada","country_code":"CA","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":1,"2/20/20":5,"2/21/20":6,"2/22/20":6,"2/23/20":6,"2/24/20":6,"2/25/20":7,"2/26/20":7,"2/27/20":7,"2/28/20":7,"2/29/20":8,"2/3/20":1,"2/4/20":1,"2/5/20":2,"2/6/20":2,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":8,"3/10/20":32,"3/11/20":39,"3/12/20":46,"3/13/20":64,"3/14/20":64,"3/15/20":73,"3/2/20":8,"3/3/20":9,"3/4/20":12,"3/5/20":13,"3/6/20":21,"3/7/20":21,"3/8/20":27,"3/9/20":32},"latest":73,"province":"British Columbia"},{"coordinates":{"lat":"-33.8688","long":"151.2093"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":3,"1/27/20":4,"1/28/20":4,"1/29/20":4,"1/30/20":4,"1/31/20":4,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":4,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":6,"3/10/20":55,"3/11/20":65,"3/12/20":65,"3/13/20":92,"3/14/20":112,"3/15/20":134,"3/2/20":6,"3/3/20":13,"3/4/20":22,"3/5/20":22,"3/6/20":26,"3/7/20":28,"3/8/20":38,"3/9/20":48},"latest":134,"province":"New South Wales"},{"coordinates":{"lat":"-37.8136","long":"144.9631"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":2,"1/31/20":3,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":7,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":7,"3/10/20":18,"3/11/20":21,"3/12/20":21,"3/13/20":36,"3/14/20":49,"3/15/20":57,"3/2/20":9,"3/3/20":9,"3/4/20":10,"3/5/20":10,"3/6/20":10,"3/7/20":11,"3/8/20":11,"3/9/20":15},"latest":57,"province":"Victoria"},{"coordinates":{"lat":"-28.0167","long":"153.4"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":0,"1/29/20":1,"1/30/20":3,"1/31/20":2,"2/1/20":3,"2/10/20":5,"2/11/20":5,"2/12/20":5,"2/13/20":5,"2/14/20":5,"2/15/20":5,"2/16/20":5,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":2,"2/20/20":5,"2/21/20":5,"2/22/20":5,"2/23/20":5,"2/24/20":5,"2/25/20":5,"2/26/20":5,"2/27/20":5,"2/28/20":5,"2/29/20":9,"2/3/20":2,"2/4/20":3,"2/5/20":3,"2/6/20":4,"2/7/20":5,"2/8/20":5,"2/9/20":5,"3/1/20":9,"3/10/20":18,"3/11/20":20,"3/12/20":20,"3/13/20":35,"3/14/20":46,"3/15/20":61,"3/2/20":9,"3/3/20":11,"3/4/20":11,"3/5/20":13,"3/6/20":13,"3/7/20":13,"3/8/20":15,"3/9/20":15},"latest":61,"province":"Queensland"},{"coordinates":{"lat":"11.55","long":"104.9167"},"country":"Cambodia","country_code":"KH","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":2,"3/11/20":3,"3/12/20":3,"3/13/20":5,"3/14/20":7,"3/15/20":7,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":2,"3/9/20":2},"latest":7,"province":""}],"source":"https://github.com/ExpDev07/coronavirus-tracker-api"} +{ + "last_updated":"2020-03-17T10:23:22.505550Z", + "latest":1940, + "locations":[ + { + "coordinates":{ + "lat":"15", + "long":"101" + }, + "country":"Thailand", + "country_code":"TH", + "history":{ + "1/22/20":2, + "1/23/20":3, + "1/24/20":5, + "1/25/20":7, + "1/26/20":8, + "1/27/20":8, + "1/28/20":14, + "1/29/20":14, + "1/30/20":14, + "1/31/20":19, + "2/1/20":19, + "2/10/20":32, + "2/11/20":33, + "2/12/20":33, + "2/13/20":33, + "2/14/20":33, + "2/15/20":33, + "2/16/20":34, + "2/17/20":35, + "2/18/20":35, + "2/19/20":35, + "2/2/20":19, + "2/20/20":35, + "2/21/20":35, + "2/22/20":35, + "2/23/20":35, + "2/24/20":35, + "2/25/20":37, + "2/26/20":40, + "2/27/20":40, + "2/28/20":41, + "2/29/20":42, + "2/3/20":19, + "2/4/20":25, + "2/5/20":25, + "2/6/20":25, + "2/7/20":25, + "2/8/20":32, + "2/9/20":32, + "3/1/20":42, + "3/10/20":53, + "3/11/20":59, + "3/12/20":70, + "3/13/20":75, + "3/14/20":82, + "3/15/20":114, + "3/2/20":43, + "3/3/20":43, + "3/4/20":43, + "3/5/20":47, + "3/6/20":48, + "3/7/20":50, + "3/8/20":50, + "3/9/20":50 + }, + "latest":114, + "province":"" + }, + { + "coordinates":{ + "lat":"36", + "long":"138" + }, + "country":"Japan", + "country_code":"JP", + "history":{ + "1/22/20":2, + "1/23/20":1, + "1/24/20":2, + "1/25/20":2, + "1/26/20":4, + "1/27/20":4, + "1/28/20":7, + "1/29/20":7, + "1/30/20":11, + "1/31/20":15, + "2/1/20":20, + "2/10/20":26, + "2/11/20":26, + "2/12/20":28, + "2/13/20":28, + "2/14/20":29, + "2/15/20":43, + "2/16/20":59, + "2/17/20":66, + "2/18/20":74, + "2/19/20":84, + "2/2/20":20, + "2/20/20":94, + "2/21/20":105, + "2/22/20":122, + "2/23/20":147, + "2/24/20":159, + "2/25/20":170, + "2/26/20":189, + "2/27/20":214, + "2/28/20":228, + "2/29/20":241, + "2/3/20":20, + "2/4/20":22, + "2/5/20":22, + "2/6/20":45, + "2/7/20":25, + "2/8/20":25, + "2/9/20":26, + "3/1/20":256, + "3/10/20":581, + "3/11/20":639, + "3/12/20":639, + "3/13/20":701, + "3/14/20":773, + "3/15/20":839, + "3/2/20":274, + "3/3/20":293, + "3/4/20":331, + "3/5/20":360, + "3/6/20":420, + "3/7/20":461, + "3/8/20":502, + "3/9/20":511 + }, + "latest":839, + "province":"" + }, + { + "coordinates":{ + "lat":"1.2833", + "long":"103.8333" + }, + "country":"Singapore", + "country_code":"SG", + "history":{ + "1/22/20":0, + "1/23/20":1, + "1/24/20":3, + "1/25/20":3, + "1/26/20":4, + "1/27/20":5, + "1/28/20":7, + "1/29/20":7, + "1/30/20":10, + "1/31/20":13, + "2/1/20":16, + "2/10/20":45, + "2/11/20":47, + "2/12/20":50, + "2/13/20":58, + "2/14/20":67, + "2/15/20":72, + "2/16/20":75, + "2/17/20":77, + "2/18/20":81, + "2/19/20":84, + "2/2/20":18, + "2/20/20":84, + "2/21/20":85, + "2/22/20":85, + "2/23/20":89, + "2/24/20":89, + "2/25/20":91, + "2/26/20":93, + "2/27/20":93, + "2/28/20":93, + "2/29/20":102, + "2/3/20":18, + "2/4/20":24, + "2/5/20":28, + "2/6/20":28, + "2/7/20":30, + "2/8/20":33, + "2/9/20":40, + "3/1/20":106, + "3/10/20":160, + "3/11/20":178, + "3/12/20":178, + "3/13/20":200, + "3/14/20":212, + "3/15/20":226, + "3/2/20":108, + "3/3/20":110, + "3/4/20":110, + "3/5/20":117, + "3/6/20":130, + "3/7/20":138, + "3/8/20":150, + "3/9/20":150 + }, + "latest":226, + "province":"" + }, + { + "coordinates":{ + "lat":"28.1667", + "long":"84.25" + }, + "country":"Nepal", + "country_code":"NP", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":1, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":1, + "3/11/20":1, + "3/12/20":1, + "3/13/20":1, + "3/14/20":1, + "3/15/20":1, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":1, + "3/9/20":1 + }, + "latest":1, + "province":"" + }, + { + "coordinates":{ + "lat":"2.5", + "long":"112.5" + }, + "country":"Malaysia", + "country_code":"MY", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":3, + "1/26/20":4, + "1/27/20":4, + "1/28/20":4, + "1/29/20":7, + "1/30/20":8, + "1/31/20":8, + "2/1/20":8, + "2/10/20":18, + "2/11/20":18, + "2/12/20":18, + "2/13/20":19, + "2/14/20":19, + "2/15/20":22, + "2/16/20":22, + "2/17/20":22, + "2/18/20":22, + "2/19/20":22, + "2/2/20":8, + "2/20/20":22, + "2/21/20":22, + "2/22/20":22, + "2/23/20":22, + "2/24/20":22, + "2/25/20":22, + "2/26/20":22, + "2/27/20":23, + "2/28/20":23, + "2/29/20":25, + "2/3/20":8, + "2/4/20":10, + "2/5/20":12, + "2/6/20":12, + "2/7/20":12, + "2/8/20":16, + "2/9/20":16, + "3/1/20":29, + "3/10/20":129, + "3/11/20":149, + "3/12/20":149, + "3/13/20":197, + "3/14/20":238, + "3/15/20":428, + "3/2/20":29, + "3/3/20":36, + "3/4/20":50, + "3/5/20":50, + "3/6/20":83, + "3/7/20":93, + "3/8/20":99, + "3/9/20":117 + }, + "latest":428, + "province":"" + }, + { + "coordinates":{ + "lat":"49.2827", + "long":"-123.1207" + }, + "country":"Canada", + "country_code":"CA", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":1, + "2/20/20":5, + "2/21/20":6, + "2/22/20":6, + "2/23/20":6, + "2/24/20":6, + "2/25/20":7, + "2/26/20":7, + "2/27/20":7, + "2/28/20":7, + "2/29/20":8, + "2/3/20":1, + "2/4/20":1, + "2/5/20":2, + "2/6/20":2, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":8, + "3/10/20":32, + "3/11/20":39, + "3/12/20":46, + "3/13/20":64, + "3/14/20":64, + "3/15/20":73, + "3/2/20":8, + "3/3/20":9, + "3/4/20":12, + "3/5/20":13, + "3/6/20":21, + "3/7/20":21, + "3/8/20":27, + "3/9/20":32 + }, + "latest":73, + "province":"British Columbia" + }, + { + "coordinates":{ + "lat":"-33.8688", + "long":"151.2093" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":3, + "1/27/20":4, + "1/28/20":4, + "1/29/20":4, + "1/30/20":4, + "1/31/20":4, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":4, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":6, + "3/10/20":55, + "3/11/20":65, + "3/12/20":65, + "3/13/20":92, + "3/14/20":112, + "3/15/20":134, + "3/2/20":6, + "3/3/20":13, + "3/4/20":22, + "3/5/20":22, + "3/6/20":26, + "3/7/20":28, + "3/8/20":38, + "3/9/20":48 + }, + "latest":134, + "province":"New South Wales" + }, + { + "coordinates":{ + "lat":"-37.8136", + "long":"144.9631" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":2, + "1/31/20":3, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":7, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":7, + "3/10/20":18, + "3/11/20":21, + "3/12/20":21, + "3/13/20":36, + "3/14/20":49, + "3/15/20":57, + "3/2/20":9, + "3/3/20":9, + "3/4/20":10, + "3/5/20":10, + "3/6/20":10, + "3/7/20":11, + "3/8/20":11, + "3/9/20":15 + }, + "latest":57, + "province":"Victoria" + }, + { + "coordinates":{ + "lat":"-28.0167", + "long":"153.4" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":0, + "1/29/20":1, + "1/30/20":3, + "1/31/20":2, + "2/1/20":3, + "2/10/20":5, + "2/11/20":5, + "2/12/20":5, + "2/13/20":5, + "2/14/20":5, + "2/15/20":5, + "2/16/20":5, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":2, + "2/20/20":5, + "2/21/20":5, + "2/22/20":5, + "2/23/20":5, + "2/24/20":5, + "2/25/20":5, + "2/26/20":5, + "2/27/20":5, + "2/28/20":5, + "2/29/20":9, + "2/3/20":2, + "2/4/20":3, + "2/5/20":3, + "2/6/20":4, + "2/7/20":5, + "2/8/20":5, + "2/9/20":5, + "3/1/20":9, + "3/10/20":18, + "3/11/20":20, + "3/12/20":20, + "3/13/20":35, + "3/14/20":46, + "3/15/20":61, + "3/2/20":9, + "3/3/20":11, + "3/4/20":11, + "3/5/20":13, + "3/6/20":13, + "3/7/20":13, + "3/8/20":15, + "3/9/20":15 + }, + "latest":61, + "province":"Queensland" + }, + { + "coordinates":{ + "lat":"11.55", + "long":"104.9167" + }, + "country":"Cambodia", + "country_code":"KH", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":2, + "3/11/20":3, + "3/12/20":3, + "3/13/20":5, + "3/14/20":7, + "3/15/20":7, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":2, + "3/9/20":2 + }, + "latest":7, + "province":"" + } + ], + "source":"https://github.com/ExpDev07/coronavirus-tracker-api" +} diff --git a/tests/expected_output/v1_deaths.json b/tests/expected_output/v1_deaths.json index 48dc9cc2..6dc57d57 100644 --- a/tests/expected_output/v1_deaths.json +++ b/tests/expected_output/v1_deaths.json @@ -1 +1,667 @@ -{"last_updated":"2020-03-17T10:23:22.505550Z","latest":1940,"locations":[{"coordinates":{"lat":"15","long":"101"},"country":"Thailand","country_code":"TH","history":{"1/22/20":2,"1/23/20":3,"1/24/20":5,"1/25/20":7,"1/26/20":8,"1/27/20":8,"1/28/20":14,"1/29/20":14,"1/30/20":14,"1/31/20":19,"2/1/20":19,"2/10/20":32,"2/11/20":33,"2/12/20":33,"2/13/20":33,"2/14/20":33,"2/15/20":33,"2/16/20":34,"2/17/20":35,"2/18/20":35,"2/19/20":35,"2/2/20":19,"2/20/20":35,"2/21/20":35,"2/22/20":35,"2/23/20":35,"2/24/20":35,"2/25/20":37,"2/26/20":40,"2/27/20":40,"2/28/20":41,"2/29/20":42,"2/3/20":19,"2/4/20":25,"2/5/20":25,"2/6/20":25,"2/7/20":25,"2/8/20":32,"2/9/20":32,"3/1/20":42,"3/10/20":53,"3/11/20":59,"3/12/20":70,"3/13/20":75,"3/14/20":82,"3/15/20":114,"3/2/20":43,"3/3/20":43,"3/4/20":43,"3/5/20":47,"3/6/20":48,"3/7/20":50,"3/8/20":50,"3/9/20":50},"latest":114,"province":""},{"coordinates":{"lat":"36","long":"138"},"country":"Japan","country_code":"JP","history":{"1/22/20":2,"1/23/20":1,"1/24/20":2,"1/25/20":2,"1/26/20":4,"1/27/20":4,"1/28/20":7,"1/29/20":7,"1/30/20":11,"1/31/20":15,"2/1/20":20,"2/10/20":26,"2/11/20":26,"2/12/20":28,"2/13/20":28,"2/14/20":29,"2/15/20":43,"2/16/20":59,"2/17/20":66,"2/18/20":74,"2/19/20":84,"2/2/20":20,"2/20/20":94,"2/21/20":105,"2/22/20":122,"2/23/20":147,"2/24/20":159,"2/25/20":170,"2/26/20":189,"2/27/20":214,"2/28/20":228,"2/29/20":241,"2/3/20":20,"2/4/20":22,"2/5/20":22,"2/6/20":45,"2/7/20":25,"2/8/20":25,"2/9/20":26,"3/1/20":256,"3/10/20":581,"3/11/20":639,"3/12/20":639,"3/13/20":701,"3/14/20":773,"3/15/20":839,"3/2/20":274,"3/3/20":293,"3/4/20":331,"3/5/20":360,"3/6/20":420,"3/7/20":461,"3/8/20":502,"3/9/20":511},"latest":839,"province":""},{"coordinates":{"lat":"1.2833","long":"103.8333"},"country":"Singapore","country_code":"SG","history":{"1/22/20":0,"1/23/20":1,"1/24/20":3,"1/25/20":3,"1/26/20":4,"1/27/20":5,"1/28/20":7,"1/29/20":7,"1/30/20":10,"1/31/20":13,"2/1/20":16,"2/10/20":45,"2/11/20":47,"2/12/20":50,"2/13/20":58,"2/14/20":67,"2/15/20":72,"2/16/20":75,"2/17/20":77,"2/18/20":81,"2/19/20":84,"2/2/20":18,"2/20/20":84,"2/21/20":85,"2/22/20":85,"2/23/20":89,"2/24/20":89,"2/25/20":91,"2/26/20":93,"2/27/20":93,"2/28/20":93,"2/29/20":102,"2/3/20":18,"2/4/20":24,"2/5/20":28,"2/6/20":28,"2/7/20":30,"2/8/20":33,"2/9/20":40,"3/1/20":106,"3/10/20":160,"3/11/20":178,"3/12/20":178,"3/13/20":200,"3/14/20":212,"3/15/20":226,"3/2/20":108,"3/3/20":110,"3/4/20":110,"3/5/20":117,"3/6/20":130,"3/7/20":138,"3/8/20":150,"3/9/20":150},"latest":226,"province":""},{"coordinates":{"lat":"28.1667","long":"84.25"},"country":"Nepal","country_code":"NP","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":1,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":1,"3/11/20":1,"3/12/20":1,"3/13/20":1,"3/14/20":1,"3/15/20":1,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":1,"3/9/20":1},"latest":1,"province":""},{"coordinates":{"lat":"2.5","long":"112.5"},"country":"Malaysia","country_code":"MY","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":3,"1/26/20":4,"1/27/20":4,"1/28/20":4,"1/29/20":7,"1/30/20":8,"1/31/20":8,"2/1/20":8,"2/10/20":18,"2/11/20":18,"2/12/20":18,"2/13/20":19,"2/14/20":19,"2/15/20":22,"2/16/20":22,"2/17/20":22,"2/18/20":22,"2/19/20":22,"2/2/20":8,"2/20/20":22,"2/21/20":22,"2/22/20":22,"2/23/20":22,"2/24/20":22,"2/25/20":22,"2/26/20":22,"2/27/20":23,"2/28/20":23,"2/29/20":25,"2/3/20":8,"2/4/20":10,"2/5/20":12,"2/6/20":12,"2/7/20":12,"2/8/20":16,"2/9/20":16,"3/1/20":29,"3/10/20":129,"3/11/20":149,"3/12/20":149,"3/13/20":197,"3/14/20":238,"3/15/20":428,"3/2/20":29,"3/3/20":36,"3/4/20":50,"3/5/20":50,"3/6/20":83,"3/7/20":93,"3/8/20":99,"3/9/20":117},"latest":428,"province":""},{"coordinates":{"lat":"49.2827","long":"-123.1207"},"country":"Canada","country_code":"CA","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":1,"2/20/20":5,"2/21/20":6,"2/22/20":6,"2/23/20":6,"2/24/20":6,"2/25/20":7,"2/26/20":7,"2/27/20":7,"2/28/20":7,"2/29/20":8,"2/3/20":1,"2/4/20":1,"2/5/20":2,"2/6/20":2,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":8,"3/10/20":32,"3/11/20":39,"3/12/20":46,"3/13/20":64,"3/14/20":64,"3/15/20":73,"3/2/20":8,"3/3/20":9,"3/4/20":12,"3/5/20":13,"3/6/20":21,"3/7/20":21,"3/8/20":27,"3/9/20":32},"latest":73,"province":"British Columbia"},{"coordinates":{"lat":"-33.8688","long":"151.2093"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":3,"1/27/20":4,"1/28/20":4,"1/29/20":4,"1/30/20":4,"1/31/20":4,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":4,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":6,"3/10/20":55,"3/11/20":65,"3/12/20":65,"3/13/20":92,"3/14/20":112,"3/15/20":134,"3/2/20":6,"3/3/20":13,"3/4/20":22,"3/5/20":22,"3/6/20":26,"3/7/20":28,"3/8/20":38,"3/9/20":48},"latest":134,"province":"New South Wales"},{"coordinates":{"lat":"-37.8136","long":"144.9631"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":2,"1/31/20":3,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":7,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":7,"3/10/20":18,"3/11/20":21,"3/12/20":21,"3/13/20":36,"3/14/20":49,"3/15/20":57,"3/2/20":9,"3/3/20":9,"3/4/20":10,"3/5/20":10,"3/6/20":10,"3/7/20":11,"3/8/20":11,"3/9/20":15},"latest":57,"province":"Victoria"},{"coordinates":{"lat":"-28.0167","long":"153.4"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":0,"1/29/20":1,"1/30/20":3,"1/31/20":2,"2/1/20":3,"2/10/20":5,"2/11/20":5,"2/12/20":5,"2/13/20":5,"2/14/20":5,"2/15/20":5,"2/16/20":5,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":2,"2/20/20":5,"2/21/20":5,"2/22/20":5,"2/23/20":5,"2/24/20":5,"2/25/20":5,"2/26/20":5,"2/27/20":5,"2/28/20":5,"2/29/20":9,"2/3/20":2,"2/4/20":3,"2/5/20":3,"2/6/20":4,"2/7/20":5,"2/8/20":5,"2/9/20":5,"3/1/20":9,"3/10/20":18,"3/11/20":20,"3/12/20":20,"3/13/20":35,"3/14/20":46,"3/15/20":61,"3/2/20":9,"3/3/20":11,"3/4/20":11,"3/5/20":13,"3/6/20":13,"3/7/20":13,"3/8/20":15,"3/9/20":15},"latest":61,"province":"Queensland"},{"coordinates":{"lat":"11.55","long":"104.9167"},"country":"Cambodia","country_code":"KH","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":2,"3/11/20":3,"3/12/20":3,"3/13/20":5,"3/14/20":7,"3/15/20":7,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":2,"3/9/20":2},"latest":7,"province":""}],"source":"https://github.com/ExpDev07/coronavirus-tracker-api"} +{ + "last_updated":"2020-03-17T10:23:22.505550Z", + "latest":1940, + "locations":[ + { + "coordinates":{ + "lat":"15", + "long":"101" + }, + "country":"Thailand", + "country_code":"TH", + "history":{ + "1/22/20":2, + "1/23/20":3, + "1/24/20":5, + "1/25/20":7, + "1/26/20":8, + "1/27/20":8, + "1/28/20":14, + "1/29/20":14, + "1/30/20":14, + "1/31/20":19, + "2/1/20":19, + "2/10/20":32, + "2/11/20":33, + "2/12/20":33, + "2/13/20":33, + "2/14/20":33, + "2/15/20":33, + "2/16/20":34, + "2/17/20":35, + "2/18/20":35, + "2/19/20":35, + "2/2/20":19, + "2/20/20":35, + "2/21/20":35, + "2/22/20":35, + "2/23/20":35, + "2/24/20":35, + "2/25/20":37, + "2/26/20":40, + "2/27/20":40, + "2/28/20":41, + "2/29/20":42, + "2/3/20":19, + "2/4/20":25, + "2/5/20":25, + "2/6/20":25, + "2/7/20":25, + "2/8/20":32, + "2/9/20":32, + "3/1/20":42, + "3/10/20":53, + "3/11/20":59, + "3/12/20":70, + "3/13/20":75, + "3/14/20":82, + "3/15/20":114, + "3/2/20":43, + "3/3/20":43, + "3/4/20":43, + "3/5/20":47, + "3/6/20":48, + "3/7/20":50, + "3/8/20":50, + "3/9/20":50 + }, + "latest":114, + "province":"" + }, + { + "coordinates":{ + "lat":"36", + "long":"138" + }, + "country":"Japan", + "country_code":"JP", + "history":{ + "1/22/20":2, + "1/23/20":1, + "1/24/20":2, + "1/25/20":2, + "1/26/20":4, + "1/27/20":4, + "1/28/20":7, + "1/29/20":7, + "1/30/20":11, + "1/31/20":15, + "2/1/20":20, + "2/10/20":26, + "2/11/20":26, + "2/12/20":28, + "2/13/20":28, + "2/14/20":29, + "2/15/20":43, + "2/16/20":59, + "2/17/20":66, + "2/18/20":74, + "2/19/20":84, + "2/2/20":20, + "2/20/20":94, + "2/21/20":105, + "2/22/20":122, + "2/23/20":147, + "2/24/20":159, + "2/25/20":170, + "2/26/20":189, + "2/27/20":214, + "2/28/20":228, + "2/29/20":241, + "2/3/20":20, + "2/4/20":22, + "2/5/20":22, + "2/6/20":45, + "2/7/20":25, + "2/8/20":25, + "2/9/20":26, + "3/1/20":256, + "3/10/20":581, + "3/11/20":639, + "3/12/20":639, + "3/13/20":701, + "3/14/20":773, + "3/15/20":839, + "3/2/20":274, + "3/3/20":293, + "3/4/20":331, + "3/5/20":360, + "3/6/20":420, + "3/7/20":461, + "3/8/20":502, + "3/9/20":511 + }, + "latest":839, + "province":"" + }, + { + "coordinates":{ + "lat":"1.2833", + "long":"103.8333" + }, + "country":"Singapore", + "country_code":"SG", + "history":{ + "1/22/20":0, + "1/23/20":1, + "1/24/20":3, + "1/25/20":3, + "1/26/20":4, + "1/27/20":5, + "1/28/20":7, + "1/29/20":7, + "1/30/20":10, + "1/31/20":13, + "2/1/20":16, + "2/10/20":45, + "2/11/20":47, + "2/12/20":50, + "2/13/20":58, + "2/14/20":67, + "2/15/20":72, + "2/16/20":75, + "2/17/20":77, + "2/18/20":81, + "2/19/20":84, + "2/2/20":18, + "2/20/20":84, + "2/21/20":85, + "2/22/20":85, + "2/23/20":89, + "2/24/20":89, + "2/25/20":91, + "2/26/20":93, + "2/27/20":93, + "2/28/20":93, + "2/29/20":102, + "2/3/20":18, + "2/4/20":24, + "2/5/20":28, + "2/6/20":28, + "2/7/20":30, + "2/8/20":33, + "2/9/20":40, + "3/1/20":106, + "3/10/20":160, + "3/11/20":178, + "3/12/20":178, + "3/13/20":200, + "3/14/20":212, + "3/15/20":226, + "3/2/20":108, + "3/3/20":110, + "3/4/20":110, + "3/5/20":117, + "3/6/20":130, + "3/7/20":138, + "3/8/20":150, + "3/9/20":150 + }, + "latest":226, + "province":"" + }, + { + "coordinates":{ + "lat":"28.1667", + "long":"84.25" + }, + "country":"Nepal", + "country_code":"NP", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":1, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":1, + "3/11/20":1, + "3/12/20":1, + "3/13/20":1, + "3/14/20":1, + "3/15/20":1, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":1, + "3/9/20":1 + }, + "latest":1, + "province":"" + }, + { + "coordinates":{ + "lat":"2.5", + "long":"112.5" + }, + "country":"Malaysia", + "country_code":"MY", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":3, + "1/26/20":4, + "1/27/20":4, + "1/28/20":4, + "1/29/20":7, + "1/30/20":8, + "1/31/20":8, + "2/1/20":8, + "2/10/20":18, + "2/11/20":18, + "2/12/20":18, + "2/13/20":19, + "2/14/20":19, + "2/15/20":22, + "2/16/20":22, + "2/17/20":22, + "2/18/20":22, + "2/19/20":22, + "2/2/20":8, + "2/20/20":22, + "2/21/20":22, + "2/22/20":22, + "2/23/20":22, + "2/24/20":22, + "2/25/20":22, + "2/26/20":22, + "2/27/20":23, + "2/28/20":23, + "2/29/20":25, + "2/3/20":8, + "2/4/20":10, + "2/5/20":12, + "2/6/20":12, + "2/7/20":12, + "2/8/20":16, + "2/9/20":16, + "3/1/20":29, + "3/10/20":129, + "3/11/20":149, + "3/12/20":149, + "3/13/20":197, + "3/14/20":238, + "3/15/20":428, + "3/2/20":29, + "3/3/20":36, + "3/4/20":50, + "3/5/20":50, + "3/6/20":83, + "3/7/20":93, + "3/8/20":99, + "3/9/20":117 + }, + "latest":428, + "province":"" + }, + { + "coordinates":{ + "lat":"49.2827", + "long":"-123.1207" + }, + "country":"Canada", + "country_code":"CA", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":1, + "2/20/20":5, + "2/21/20":6, + "2/22/20":6, + "2/23/20":6, + "2/24/20":6, + "2/25/20":7, + "2/26/20":7, + "2/27/20":7, + "2/28/20":7, + "2/29/20":8, + "2/3/20":1, + "2/4/20":1, + "2/5/20":2, + "2/6/20":2, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":8, + "3/10/20":32, + "3/11/20":39, + "3/12/20":46, + "3/13/20":64, + "3/14/20":64, + "3/15/20":73, + "3/2/20":8, + "3/3/20":9, + "3/4/20":12, + "3/5/20":13, + "3/6/20":21, + "3/7/20":21, + "3/8/20":27, + "3/9/20":32 + }, + "latest":73, + "province":"British Columbia" + }, + { + "coordinates":{ + "lat":"-33.8688", + "long":"151.2093" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":3, + "1/27/20":4, + "1/28/20":4, + "1/29/20":4, + "1/30/20":4, + "1/31/20":4, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":4, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":6, + "3/10/20":55, + "3/11/20":65, + "3/12/20":65, + "3/13/20":92, + "3/14/20":112, + "3/15/20":134, + "3/2/20":6, + "3/3/20":13, + "3/4/20":22, + "3/5/20":22, + "3/6/20":26, + "3/7/20":28, + "3/8/20":38, + "3/9/20":48 + }, + "latest":134, + "province":"New South Wales" + }, + { + "coordinates":{ + "lat":"-37.8136", + "long":"144.9631" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":2, + "1/31/20":3, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":7, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":7, + "3/10/20":18, + "3/11/20":21, + "3/12/20":21, + "3/13/20":36, + "3/14/20":49, + "3/15/20":57, + "3/2/20":9, + "3/3/20":9, + "3/4/20":10, + "3/5/20":10, + "3/6/20":10, + "3/7/20":11, + "3/8/20":11, + "3/9/20":15 + }, + "latest":57, + "province":"Victoria" + }, + { + "coordinates":{ + "lat":"-28.0167", + "long":"153.4" + }, + "country":"Australia", + "country_code":"AU", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":0, + "1/29/20":1, + "1/30/20":3, + "1/31/20":2, + "2/1/20":3, + "2/10/20":5, + "2/11/20":5, + "2/12/20":5, + "2/13/20":5, + "2/14/20":5, + "2/15/20":5, + "2/16/20":5, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":2, + "2/20/20":5, + "2/21/20":5, + "2/22/20":5, + "2/23/20":5, + "2/24/20":5, + "2/25/20":5, + "2/26/20":5, + "2/27/20":5, + "2/28/20":5, + "2/29/20":9, + "2/3/20":2, + "2/4/20":3, + "2/5/20":3, + "2/6/20":4, + "2/7/20":5, + "2/8/20":5, + "2/9/20":5, + "3/1/20":9, + "3/10/20":18, + "3/11/20":20, + "3/12/20":20, + "3/13/20":35, + "3/14/20":46, + "3/15/20":61, + "3/2/20":9, + "3/3/20":11, + "3/4/20":11, + "3/5/20":13, + "3/6/20":13, + "3/7/20":13, + "3/8/20":15, + "3/9/20":15 + }, + "latest":61, + "province":"Queensland" + }, + { + "coordinates":{ + "lat":"11.55", + "long":"104.9167" + }, + "country":"Cambodia", + "country_code":"KH", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":2, + "3/11/20":3, + "3/12/20":3, + "3/13/20":5, + "3/14/20":7, + "3/15/20":7, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":2, + "3/9/20":2 + }, + "latest":7, + "province":"" + } + ], + "source":"https://github.com/ExpDev07/coronavirus-tracker-api" +} diff --git a/tests/expected_output/v1_recovered.json b/tests/expected_output/v1_recovered.json index 48dc9cc2..44669db7 100644 --- a/tests/expected_output/v1_recovered.json +++ b/tests/expected_output/v1_recovered.json @@ -1 +1,671 @@ -{"last_updated":"2020-03-17T10:23:22.505550Z","latest":1940,"locations":[{"coordinates":{"lat":"15","long":"101"},"country":"Thailand","country_code":"TH","history":{"1/22/20":2,"1/23/20":3,"1/24/20":5,"1/25/20":7,"1/26/20":8,"1/27/20":8,"1/28/20":14,"1/29/20":14,"1/30/20":14,"1/31/20":19,"2/1/20":19,"2/10/20":32,"2/11/20":33,"2/12/20":33,"2/13/20":33,"2/14/20":33,"2/15/20":33,"2/16/20":34,"2/17/20":35,"2/18/20":35,"2/19/20":35,"2/2/20":19,"2/20/20":35,"2/21/20":35,"2/22/20":35,"2/23/20":35,"2/24/20":35,"2/25/20":37,"2/26/20":40,"2/27/20":40,"2/28/20":41,"2/29/20":42,"2/3/20":19,"2/4/20":25,"2/5/20":25,"2/6/20":25,"2/7/20":25,"2/8/20":32,"2/9/20":32,"3/1/20":42,"3/10/20":53,"3/11/20":59,"3/12/20":70,"3/13/20":75,"3/14/20":82,"3/15/20":114,"3/2/20":43,"3/3/20":43,"3/4/20":43,"3/5/20":47,"3/6/20":48,"3/7/20":50,"3/8/20":50,"3/9/20":50},"latest":114,"province":""},{"coordinates":{"lat":"36","long":"138"},"country":"Japan","country_code":"JP","history":{"1/22/20":2,"1/23/20":1,"1/24/20":2,"1/25/20":2,"1/26/20":4,"1/27/20":4,"1/28/20":7,"1/29/20":7,"1/30/20":11,"1/31/20":15,"2/1/20":20,"2/10/20":26,"2/11/20":26,"2/12/20":28,"2/13/20":28,"2/14/20":29,"2/15/20":43,"2/16/20":59,"2/17/20":66,"2/18/20":74,"2/19/20":84,"2/2/20":20,"2/20/20":94,"2/21/20":105,"2/22/20":122,"2/23/20":147,"2/24/20":159,"2/25/20":170,"2/26/20":189,"2/27/20":214,"2/28/20":228,"2/29/20":241,"2/3/20":20,"2/4/20":22,"2/5/20":22,"2/6/20":45,"2/7/20":25,"2/8/20":25,"2/9/20":26,"3/1/20":256,"3/10/20":581,"3/11/20":639,"3/12/20":639,"3/13/20":701,"3/14/20":773,"3/15/20":839,"3/2/20":274,"3/3/20":293,"3/4/20":331,"3/5/20":360,"3/6/20":420,"3/7/20":461,"3/8/20":502,"3/9/20":511},"latest":839,"province":""},{"coordinates":{"lat":"1.2833","long":"103.8333"},"country":"Singapore","country_code":"SG","history":{"1/22/20":0,"1/23/20":1,"1/24/20":3,"1/25/20":3,"1/26/20":4,"1/27/20":5,"1/28/20":7,"1/29/20":7,"1/30/20":10,"1/31/20":13,"2/1/20":16,"2/10/20":45,"2/11/20":47,"2/12/20":50,"2/13/20":58,"2/14/20":67,"2/15/20":72,"2/16/20":75,"2/17/20":77,"2/18/20":81,"2/19/20":84,"2/2/20":18,"2/20/20":84,"2/21/20":85,"2/22/20":85,"2/23/20":89,"2/24/20":89,"2/25/20":91,"2/26/20":93,"2/27/20":93,"2/28/20":93,"2/29/20":102,"2/3/20":18,"2/4/20":24,"2/5/20":28,"2/6/20":28,"2/7/20":30,"2/8/20":33,"2/9/20":40,"3/1/20":106,"3/10/20":160,"3/11/20":178,"3/12/20":178,"3/13/20":200,"3/14/20":212,"3/15/20":226,"3/2/20":108,"3/3/20":110,"3/4/20":110,"3/5/20":117,"3/6/20":130,"3/7/20":138,"3/8/20":150,"3/9/20":150},"latest":226,"province":""},{"coordinates":{"lat":"28.1667","long":"84.25"},"country":"Nepal","country_code":"NP","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":1,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":1,"3/11/20":1,"3/12/20":1,"3/13/20":1,"3/14/20":1,"3/15/20":1,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":1,"3/9/20":1},"latest":1,"province":""},{"coordinates":{"lat":"2.5","long":"112.5"},"country":"Malaysia","country_code":"MY","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":3,"1/26/20":4,"1/27/20":4,"1/28/20":4,"1/29/20":7,"1/30/20":8,"1/31/20":8,"2/1/20":8,"2/10/20":18,"2/11/20":18,"2/12/20":18,"2/13/20":19,"2/14/20":19,"2/15/20":22,"2/16/20":22,"2/17/20":22,"2/18/20":22,"2/19/20":22,"2/2/20":8,"2/20/20":22,"2/21/20":22,"2/22/20":22,"2/23/20":22,"2/24/20":22,"2/25/20":22,"2/26/20":22,"2/27/20":23,"2/28/20":23,"2/29/20":25,"2/3/20":8,"2/4/20":10,"2/5/20":12,"2/6/20":12,"2/7/20":12,"2/8/20":16,"2/9/20":16,"3/1/20":29,"3/10/20":129,"3/11/20":149,"3/12/20":149,"3/13/20":197,"3/14/20":238,"3/15/20":428,"3/2/20":29,"3/3/20":36,"3/4/20":50,"3/5/20":50,"3/6/20":83,"3/7/20":93,"3/8/20":99,"3/9/20":117},"latest":428,"province":""},{"coordinates":{"lat":"49.2827","long":"-123.1207"},"country":"Canada","country_code":"CA","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":1,"2/20/20":5,"2/21/20":6,"2/22/20":6,"2/23/20":6,"2/24/20":6,"2/25/20":7,"2/26/20":7,"2/27/20":7,"2/28/20":7,"2/29/20":8,"2/3/20":1,"2/4/20":1,"2/5/20":2,"2/6/20":2,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":8,"3/10/20":32,"3/11/20":39,"3/12/20":46,"3/13/20":64,"3/14/20":64,"3/15/20":73,"3/2/20":8,"3/3/20":9,"3/4/20":12,"3/5/20":13,"3/6/20":21,"3/7/20":21,"3/8/20":27,"3/9/20":32},"latest":73,"province":"British Columbia"},{"coordinates":{"lat":"-33.8688","long":"151.2093"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":3,"1/27/20":4,"1/28/20":4,"1/29/20":4,"1/30/20":4,"1/31/20":4,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":4,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":6,"3/10/20":55,"3/11/20":65,"3/12/20":65,"3/13/20":92,"3/14/20":112,"3/15/20":134,"3/2/20":6,"3/3/20":13,"3/4/20":22,"3/5/20":22,"3/6/20":26,"3/7/20":28,"3/8/20":38,"3/9/20":48},"latest":134,"province":"New South Wales"},{"coordinates":{"lat":"-37.8136","long":"144.9631"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":1,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":2,"1/31/20":3,"2/1/20":4,"2/10/20":4,"2/11/20":4,"2/12/20":4,"2/13/20":4,"2/14/20":4,"2/15/20":4,"2/16/20":4,"2/17/20":4,"2/18/20":4,"2/19/20":4,"2/2/20":4,"2/20/20":4,"2/21/20":4,"2/22/20":4,"2/23/20":4,"2/24/20":4,"2/25/20":4,"2/26/20":4,"2/27/20":4,"2/28/20":4,"2/29/20":7,"2/3/20":4,"2/4/20":4,"2/5/20":4,"2/6/20":4,"2/7/20":4,"2/8/20":4,"2/9/20":4,"3/1/20":7,"3/10/20":18,"3/11/20":21,"3/12/20":21,"3/13/20":36,"3/14/20":49,"3/15/20":57,"3/2/20":9,"3/3/20":9,"3/4/20":10,"3/5/20":10,"3/6/20":10,"3/7/20":11,"3/8/20":11,"3/9/20":15},"latest":57,"province":"Victoria"},{"coordinates":{"lat":"-28.0167","long":"153.4"},"country":"Australia","country_code":"AU","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":0,"1/28/20":0,"1/29/20":1,"1/30/20":3,"1/31/20":2,"2/1/20":3,"2/10/20":5,"2/11/20":5,"2/12/20":5,"2/13/20":5,"2/14/20":5,"2/15/20":5,"2/16/20":5,"2/17/20":5,"2/18/20":5,"2/19/20":5,"2/2/20":2,"2/20/20":5,"2/21/20":5,"2/22/20":5,"2/23/20":5,"2/24/20":5,"2/25/20":5,"2/26/20":5,"2/27/20":5,"2/28/20":5,"2/29/20":9,"2/3/20":2,"2/4/20":3,"2/5/20":3,"2/6/20":4,"2/7/20":5,"2/8/20":5,"2/9/20":5,"3/1/20":9,"3/10/20":18,"3/11/20":20,"3/12/20":20,"3/13/20":35,"3/14/20":46,"3/15/20":61,"3/2/20":9,"3/3/20":11,"3/4/20":11,"3/5/20":13,"3/6/20":13,"3/7/20":13,"3/8/20":15,"3/9/20":15},"latest":61,"province":"Queensland"},{"coordinates":{"lat":"11.55","long":"104.9167"},"country":"Cambodia","country_code":"KH","history":{"1/22/20":0,"1/23/20":0,"1/24/20":0,"1/25/20":0,"1/26/20":0,"1/27/20":1,"1/28/20":1,"1/29/20":1,"1/30/20":1,"1/31/20":1,"2/1/20":1,"2/10/20":1,"2/11/20":1,"2/12/20":1,"2/13/20":1,"2/14/20":1,"2/15/20":1,"2/16/20":1,"2/17/20":1,"2/18/20":1,"2/19/20":1,"2/2/20":1,"2/20/20":1,"2/21/20":1,"2/22/20":1,"2/23/20":1,"2/24/20":1,"2/25/20":1,"2/26/20":1,"2/27/20":1,"2/28/20":1,"2/29/20":1,"2/3/20":1,"2/4/20":1,"2/5/20":1,"2/6/20":1,"2/7/20":1,"2/8/20":1,"2/9/20":1,"3/1/20":1,"3/10/20":2,"3/11/20":3,"3/12/20":3,"3/13/20":5,"3/14/20":7,"3/15/20":7,"3/2/20":1,"3/3/20":1,"3/4/20":1,"3/5/20":1,"3/6/20":1,"3/7/20":1,"3/8/20":2,"3/9/20":2},"latest":7,"province":""}],"source":"https://github.com/ExpDev07/coronavirus-tracker-api"} +{ + "last_updated":"2020-03-17T10:23:22.505550Z", + "latest":1940, + "locations":[ + { + "coordinates":{ + "lat":"15", + "long":"101" + }, + "country":"Thailand", + "country_code":"TH", + "history":{ + "1/22/20":2, + "1/23/20":3, + "1/24/20":5, + "1/25/20":7, + "1/26/20":8, + "1/27/20":8, + "1/28/20":14, + "1/29/20":14, + "1/30/20":14, + "1/31/20":19, + "2/1/20":19, + "2/10/20":32, + "2/11/20":33, + "2/12/20":33, + "2/13/20":33, + "2/14/20":33, + "2/15/20":33, + "2/16/20":34, + "2/17/20":35, + "2/18/20":35, + "2/19/20":35, + "2/2/20":19, + "2/20/20":35, + "2/21/20":35, + "2/22/20":35, + "2/23/20":35, + "2/24/20":35, + "2/25/20":37, + "2/26/20":40, + "2/27/20":40, + "2/28/20":41, + "2/29/20":42, + "2/3/20":19, + "2/4/20":25, + "2/5/20":25, + "2/6/20":25, + "2/7/20":25, + "2/8/20":32, + "2/9/20":32, + "3/1/20":42, + "3/10/20":53, + "3/11/20":59, + "3/12/20":70, + "3/13/20":75, + "3/14/20":82, + "3/15/20":114, + "3/2/20":43, + "3/3/20":43, + "3/4/20":43, + "3/5/20":47, + "3/6/20":48, + "3/7/20":50, + "3/8/20":50, + "3/9/20":50 + }, + "latest":114, + "province":"" + }, + { + "coordinates":{ + "lat":"36", + "long":"138" + }, + "country":"Japan", + "country_code":"JP", + "history":{ + "1/22/20":2, + "1/23/20":1, + "1/24/20":2, + "1/25/20":2, + "1/26/20":4, + "1/27/20":4, + "1/28/20":7, + "1/29/20":7, + "1/30/20":11, + "1/31/20":15, + "2/1/20":20, + "2/10/20":26, + "2/11/20":26, + "2/12/20":28, + "2/13/20":28, + "2/14/20":29, + "2/15/20":43, + "2/16/20":59, + "2/17/20":66, + "2/18/20":74, + "2/19/20":84, + "2/2/20":20, + "2/20/20":94, + "2/21/20":105, + "2/22/20":122, + "2/23/20":147, + "2/24/20":159, + "2/25/20":170, + "2/26/20":189, + "2/27/20":214, + "2/28/20":228, + "2/29/20":241, + "2/3/20":20, + "2/4/20":22, + "2/5/20":22, + "2/6/20":45, + "2/7/20":25, + "2/8/20":25, + "2/9/20":26, + "3/1/20":256, + "3/10/20":581, + "3/11/20":639, + "3/12/20":639, + "3/13/20":701, + "3/14/20":773, + "3/15/20":839, + "3/2/20":274, + "3/3/20":293, + "3/4/20":331, + "3/5/20":360, + "3/6/20":420, + "3/7/20":461, + "3/8/20":502, + "3/9/20":511 + }, + "latest":839, + "province":"" + }, + { + "coordinates":{ + "lat":"1.2833", + "long":"103.8333" + }, + "country":"Singapore", + "country_code":"SG", + "history":{ + "1/22/20":0, + "1/23/20":1, + "1/24/20":3, + "1/25/20":3, + "1/26/20":4, + "1/27/20":5, + "1/28/20":7, + "1/29/20":7, + "1/30/20":10, + "1/31/20":13, + "2/1/20":16, + "2/10/20":45, + "2/11/20":47, + "2/12/20":50, + "2/13/20":58, + "2/14/20":67, + "2/15/20":72, + "2/16/20":75, + "2/17/20":77, + "2/18/20":81, + "2/19/20":84, + "2/2/20":18, + "2/20/20":84, + "2/21/20":85, + "2/22/20":85, + "2/23/20":89, + "2/24/20":89, + "2/25/20":91, + "2/26/20":93, + "2/27/20":93, + "2/28/20":93, + "2/29/20":102, + "2/3/20":18, + "2/4/20":24, + "2/5/20":28, + "2/6/20":28, + "2/7/20":30, + "2/8/20":33, + "2/9/20":40, + "3/1/20":106, + "3/10/20":160, + "3/11/20":178, + "3/12/20":178, + "3/13/20":200, + "3/14/20":212, + "3/15/20":226, + "3/2/20":108, + "3/3/20":110, + "3/4/20":110, + "3/5/20":117, + "3/6/20":130, + "3/7/20":138, + "3/8/20":150, + "3/9/20":150 + }, + "latest":226, + "province":"" + }, + { + "coordinates":{ + "lat":"28.1667", + "long":"84.25" + }, + "country":"Nepal", + "country_code":"NP", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":1, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":1, + "3/11/20":1, + "3/12/20":1, + "3/13/20":1, + "3/14/20":1, + "3/15/20":1, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":1, + "3/9/20":1 + }, + "latest":1, + "province":"" + }, + { + "coordinates":{ + "lat":"2.5", + "long":"112.5" + }, + "country":"Malaysia", + "country_code":"MY", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":3, + "1/26/20":4, + "1/27/20":4, + "1/28/20":4, + "1/29/20":7, + "1/30/20":8, + "1/31/20":8, + "2/1/20":8, + "2/10/20":18, + "2/11/20":18, + "2/12/20":18, + "2/13/20":19, + "2/14/20":19, + "2/15/20":22, + "2/16/20":22, + "2/17/20":22, + "2/18/20":22, + "2/19/20":22, + "2/2/20":8, + "2/20/20":22, + "2/21/20":22, + "2/22/20":22, + "2/23/20":22, + "2/24/20":22, + "2/25/20":22, + "2/26/20":22, + "2/27/20":23, + "2/28/20":23, + "2/29/20":25, + "2/3/20":8, + "2/4/20":10, + "2/5/20":12, + "2/6/20":12, + "2/7/20":12, + "2/8/20":16, + "2/9/20":16, + "3/1/20":29, + "3/10/20":129, + "3/11/20":149, + "3/12/20":149, + "3/13/20":197, + "3/14/20":238, + "3/15/20":428, + "3/2/20":29, + "3/3/20":36, + "3/4/20":50, + "3/5/20":50, + "3/6/20":83, + "3/7/20":93, + "3/8/20":99, + "3/9/20":117 + }, + "latest":428, + "province":"" + }, + { + "coordinates":{ + "lat":"49.2827", + "long":"-123.1207" + }, + "country":"Canada", + "country_code":"CA", + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":1, + "2/20/20":5, + "2/21/20":6, + "2/22/20":6, + "2/23/20":6, + "2/24/20":6, + "2/25/20":7, + "2/26/20":7, + "2/27/20":7, + "2/28/20":7, + "2/29/20":8, + "2/3/20":1, + "2/4/20":1, + "2/5/20":2, + "2/6/20":2, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":8, + "3/10/20":32, + "3/11/20":39, + "3/12/20":46, + "3/13/20":64, + "3/14/20":64, + "3/15/20":73, + "3/2/20":8, + "3/3/20":9, + "3/4/20":12, + "3/5/20":13, + "3/6/20":21, + "3/7/20":21, + "3/8/20":27, + "3/9/20":32 + }, + "latest":73, + "province":"British Columbia" + }, + { + "coordinates":{ + "lat":"-33.8688", + "long":"151.2093" + }, + "country":"Australia", + "country_code":"AU", + "continent_codes_list":["OCE"], + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":3, + "1/27/20":4, + "1/28/20":4, + "1/29/20":4, + "1/30/20":4, + "1/31/20":4, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":4, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":6, + "3/10/20":55, + "3/11/20":65, + "3/12/20":65, + "3/13/20":92, + "3/14/20":112, + "3/15/20":134, + "3/2/20":6, + "3/3/20":13, + "3/4/20":22, + "3/5/20":22, + "3/6/20":26, + "3/7/20":28, + "3/8/20":38, + "3/9/20":48 + }, + "latest":134, + "province":"New South Wales" + }, + { + "coordinates":{ + "lat":"-37.8136", + "long":"144.9631" + }, + "country":"Australia", + "country_code":"AU", + "continent_codes_list":["OCE"], + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":1, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":2, + "1/31/20":3, + "2/1/20":4, + "2/10/20":4, + "2/11/20":4, + "2/12/20":4, + "2/13/20":4, + "2/14/20":4, + "2/15/20":4, + "2/16/20":4, + "2/17/20":4, + "2/18/20":4, + "2/19/20":4, + "2/2/20":4, + "2/20/20":4, + "2/21/20":4, + "2/22/20":4, + "2/23/20":4, + "2/24/20":4, + "2/25/20":4, + "2/26/20":4, + "2/27/20":4, + "2/28/20":4, + "2/29/20":7, + "2/3/20":4, + "2/4/20":4, + "2/5/20":4, + "2/6/20":4, + "2/7/20":4, + "2/8/20":4, + "2/9/20":4, + "3/1/20":7, + "3/10/20":18, + "3/11/20":21, + "3/12/20":21, + "3/13/20":36, + "3/14/20":49, + "3/15/20":57, + "3/2/20":9, + "3/3/20":9, + "3/4/20":10, + "3/5/20":10, + "3/6/20":10, + "3/7/20":11, + "3/8/20":11, + "3/9/20":15 + }, + "latest":57, + "province":"Victoria" + }, + { + "coordinates":{ + "lat":"-28.0167", + "long":"153.4" + }, + "country":"Australia", + "country_code":"AU", + "continent_codes_list":["OCE"], + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":0, + "1/28/20":0, + "1/29/20":1, + "1/30/20":3, + "1/31/20":2, + "2/1/20":3, + "2/10/20":5, + "2/11/20":5, + "2/12/20":5, + "2/13/20":5, + "2/14/20":5, + "2/15/20":5, + "2/16/20":5, + "2/17/20":5, + "2/18/20":5, + "2/19/20":5, + "2/2/20":2, + "2/20/20":5, + "2/21/20":5, + "2/22/20":5, + "2/23/20":5, + "2/24/20":5, + "2/25/20":5, + "2/26/20":5, + "2/27/20":5, + "2/28/20":5, + "2/29/20":9, + "2/3/20":2, + "2/4/20":3, + "2/5/20":3, + "2/6/20":4, + "2/7/20":5, + "2/8/20":5, + "2/9/20":5, + "3/1/20":9, + "3/10/20":18, + "3/11/20":20, + "3/12/20":20, + "3/13/20":35, + "3/14/20":46, + "3/15/20":61, + "3/2/20":9, + "3/3/20":11, + "3/4/20":11, + "3/5/20":13, + "3/6/20":13, + "3/7/20":13, + "3/8/20":15, + "3/9/20":15 + }, + "latest":61, + "province":"Queensland" + }, + { + "coordinates":{ + "lat":"11.55", + "long":"104.9167" + }, + "country":"Cambodia", + "country_code":"KH", + "continent_codes_list":["ASI"], + "history":{ + "1/22/20":0, + "1/23/20":0, + "1/24/20":0, + "1/25/20":0, + "1/26/20":0, + "1/27/20":1, + "1/28/20":1, + "1/29/20":1, + "1/30/20":1, + "1/31/20":1, + "2/1/20":1, + "2/10/20":1, + "2/11/20":1, + "2/12/20":1, + "2/13/20":1, + "2/14/20":1, + "2/15/20":1, + "2/16/20":1, + "2/17/20":1, + "2/18/20":1, + "2/19/20":1, + "2/2/20":1, + "2/20/20":1, + "2/21/20":1, + "2/22/20":1, + "2/23/20":1, + "2/24/20":1, + "2/25/20":1, + "2/26/20":1, + "2/27/20":1, + "2/28/20":1, + "2/29/20":1, + "2/3/20":1, + "2/4/20":1, + "2/5/20":1, + "2/6/20":1, + "2/7/20":1, + "2/8/20":1, + "2/9/20":1, + "3/1/20":1, + "3/10/20":2, + "3/11/20":3, + "3/12/20":3, + "3/13/20":5, + "3/14/20":7, + "3/15/20":7, + "3/2/20":1, + "3/3/20":1, + "3/4/20":1, + "3/5/20":1, + "3/6/20":1, + "3/7/20":1, + "3/8/20":2, + "3/9/20":2 + }, + "latest":7, + "province":"" + } + ], + "source":"https://github.com/ExpDev07/coronavirus-tracker-api" +} diff --git a/tests/expected_output/v2_locations.json b/tests/expected_output/v2_locations.json index e67d3f27..00a40a74 100644 --- a/tests/expected_output/v2_locations.json +++ b/tests/expected_output/v2_locations.json @@ -1 +1,154 @@ -{"locations":[{"coordinates":{"latitude":"15","longitude":"101"},"country":"Thailand","country_code":"TH","id":0,"latest":{"confirmed":114,"deaths":114,"recovered":114},"province":""},{"coordinates":{"latitude":"36","longitude":"138"},"country":"Japan","country_code":"JP","id":1,"latest":{"confirmed":839,"deaths":839,"recovered":839},"province":""},{"coordinates":{"latitude":"1.2833","longitude":"103.8333"},"country":"Singapore","country_code":"SG","id":2,"latest":{"confirmed":226,"deaths":226,"recovered":226},"province":""},{"coordinates":{"latitude":"28.1667","longitude":"84.25"},"country":"Nepal","country_code":"NP","id":3,"latest":{"confirmed":1,"deaths":1,"recovered":1},"province":""},{"coordinates":{"latitude":"2.5","longitude":"112.5"},"country":"Malaysia","country_code":"MY","id":4,"latest":{"confirmed":428,"deaths":428,"recovered":428},"province":""},{"coordinates":{"latitude":"49.2827","longitude":"-123.1207"},"country":"Canada","country_code":"CA","id":5,"latest":{"confirmed":73,"deaths":73,"recovered":73},"province":"British Columbia"},{"coordinates":{"latitude":"-33.8688","longitude":"151.2093"},"country":"Australia","country_code":"AU","id":6,"latest":{"confirmed":134,"deaths":134,"recovered":134},"province":"New South Wales"},{"coordinates":{"latitude":"-37.8136","longitude":"144.9631"},"country":"Australia","country_code":"AU","id":7,"latest":{"confirmed":57,"deaths":57,"recovered":57},"province":"Victoria"},{"coordinates":{"latitude":"-28.0167","longitude":"153.4"},"country":"Australia","country_code":"AU","id":8,"latest":{"confirmed":61,"deaths":61,"recovered":61},"province":"Queensland"},{"coordinates":{"latitude":"11.55","longitude":"104.9167"},"country":"Cambodia","country_code":"KH","id":9,"latest":{"confirmed":7,"deaths":7,"recovered":7},"province":""}]} +{ + "locations":[ + { + "coordinates":{ + "latitude":"15", + "longitude":"101" + }, + "country":"Thailand", + "country_code":"TH", + "id":0, + "latest":{ + "confirmed":114, + "deaths":114, + "recovered":114 + }, + "province":"" + }, + { + "coordinates":{ + "latitude":"36", + "longitude":"138" + }, + "country":"Japan", + "country_code":"JP", + "id":1, + "latest":{ + "confirmed":839, + "deaths":839, + "recovered":839 + }, + "province":"" + }, + { + "coordinates":{ + "latitude":"1.2833", + "longitude":"103.8333" + }, + "country":"Singapore", + "country_code":"SG", + "id":2, + "latest":{ + "confirmed":226, + "deaths":226, + "recovered":226 + }, + "province":"" + }, + { + "coordinates":{ + "latitude":"28.1667", + "longitude":"84.25" + }, + "country":"Nepal", + "country_code":"NP", + "id":3, + "latest":{ + "confirmed":1, + "deaths":1, + "recovered":1 + }, + "province":"" + }, + { + "coordinates":{ + "latitude":"2.5", + "longitude":"112.5" + }, + "country":"Malaysia", + "country_code":"MY", + "id":4, + "latest":{ + "confirmed":428, + "deaths":428, + "recovered":428 + }, + "province":"" + }, + { + "coordinates":{ + "latitude":"49.2827", + "longitude":"-123.1207" + }, + "country":"Canada", + "country_code":"CA", + "id":5, + "latest":{ + "confirmed":73, + "deaths":73, + "recovered":73 + }, + "province":"British Columbia" + }, + { + "coordinates":{ + "latitude":"-33.8688", + "longitude":"151.2093" + }, + "country":"Australia", + "country_code":"AU", + "id":6, + "latest":{ + "confirmed":134, + "deaths":134, + "recovered":134 + }, + "province":"New South Wales" + }, + { + "coordinates":{ + "latitude":"-37.8136", + "longitude":"144.9631" + }, + "country":"Australia", + "country_code":"AU", + "id":7, + "latest":{ + "confirmed":57, + "deaths":57, + "recovered":57 + }, + "province":"Victoria" + }, + { + "coordinates":{ + "latitude":"-28.0167", + "longitude":"153.4" + }, + "country":"Australia", + "country_code":"AU", + "id":8, + "latest":{ + "confirmed":61, + "deaths":61, + "recovered":61 + }, + "province":"Queensland" + }, + { + "coordinates":{ + "latitude":"11.55", + "longitude":"104.9167" + }, + "country":"Cambodia", + "country_code":"KH", + "id":9, + "latest":{ + "confirmed":7, + "deaths":7, + "recovered":7 + }, + "province":"" + } + ] +} diff --git a/tests/expected_output/v2_locations_id_1.json b/tests/expected_output/v2_locations_id_1.json index c78c4e0c..868ce83b 100644 --- a/tests/expected_output/v2_locations_id_1.json +++ b/tests/expected_output/v2_locations_id_1.json @@ -1 +1,196 @@ -{"location":{"coordinates":{"latitude":"36","longitude":"138"},"country":"Japan","country_code":"JP","id":1,"latest":{"confirmed":839,"deaths":839,"recovered":839},"province":"","timelines":{"confirmed":{"latest":839,"timeline":{"2020-01-22T00:00:00Z":2,"2020-01-23T00:00:00Z":1,"2020-01-24T00:00:00Z":2,"2020-01-25T00:00:00Z":2,"2020-01-26T00:00:00Z":4,"2020-01-27T00:00:00Z":4,"2020-01-28T00:00:00Z":7,"2020-01-29T00:00:00Z":7,"2020-01-30T00:00:00Z":11,"2020-01-31T00:00:00Z":15,"2020-02-01T00:00:00Z":20,"2020-02-02T00:00:00Z":20,"2020-02-03T00:00:00Z":20,"2020-02-04T00:00:00Z":22,"2020-02-05T00:00:00Z":22,"2020-02-06T00:00:00Z":45,"2020-02-07T00:00:00Z":25,"2020-02-08T00:00:00Z":25,"2020-02-09T00:00:00Z":26,"2020-02-10T00:00:00Z":26,"2020-02-11T00:00:00Z":26,"2020-02-12T00:00:00Z":28,"2020-02-13T00:00:00Z":28,"2020-02-14T00:00:00Z":29,"2020-02-15T00:00:00Z":43,"2020-02-16T00:00:00Z":59,"2020-02-17T00:00:00Z":66,"2020-02-18T00:00:00Z":74,"2020-02-19T00:00:00Z":84,"2020-02-20T00:00:00Z":94,"2020-02-21T00:00:00Z":105,"2020-02-22T00:00:00Z":122,"2020-02-23T00:00:00Z":147,"2020-02-24T00:00:00Z":159,"2020-02-25T00:00:00Z":170,"2020-02-26T00:00:00Z":189,"2020-02-27T00:00:00Z":214,"2020-02-28T00:00:00Z":228,"2020-02-29T00:00:00Z":241,"2020-03-01T00:00:00Z":256,"2020-03-02T00:00:00Z":274,"2020-03-03T00:00:00Z":293,"2020-03-04T00:00:00Z":331,"2020-03-05T00:00:00Z":360,"2020-03-06T00:00:00Z":420,"2020-03-07T00:00:00Z":461,"2020-03-08T00:00:00Z":502,"2020-03-09T00:00:00Z":511,"2020-03-10T00:00:00Z":581,"2020-03-11T00:00:00Z":639,"2020-03-12T00:00:00Z":639,"2020-03-13T00:00:00Z":701,"2020-03-14T00:00:00Z":773,"2020-03-15T00:00:00Z":839}},"deaths":{"latest":839,"timeline":{"2020-01-22T00:00:00Z":2,"2020-01-23T00:00:00Z":1,"2020-01-24T00:00:00Z":2,"2020-01-25T00:00:00Z":2,"2020-01-26T00:00:00Z":4,"2020-01-27T00:00:00Z":4,"2020-01-28T00:00:00Z":7,"2020-01-29T00:00:00Z":7,"2020-01-30T00:00:00Z":11,"2020-01-31T00:00:00Z":15,"2020-02-01T00:00:00Z":20,"2020-02-02T00:00:00Z":20,"2020-02-03T00:00:00Z":20,"2020-02-04T00:00:00Z":22,"2020-02-05T00:00:00Z":22,"2020-02-06T00:00:00Z":45,"2020-02-07T00:00:00Z":25,"2020-02-08T00:00:00Z":25,"2020-02-09T00:00:00Z":26,"2020-02-10T00:00:00Z":26,"2020-02-11T00:00:00Z":26,"2020-02-12T00:00:00Z":28,"2020-02-13T00:00:00Z":28,"2020-02-14T00:00:00Z":29,"2020-02-15T00:00:00Z":43,"2020-02-16T00:00:00Z":59,"2020-02-17T00:00:00Z":66,"2020-02-18T00:00:00Z":74,"2020-02-19T00:00:00Z":84,"2020-02-20T00:00:00Z":94,"2020-02-21T00:00:00Z":105,"2020-02-22T00:00:00Z":122,"2020-02-23T00:00:00Z":147,"2020-02-24T00:00:00Z":159,"2020-02-25T00:00:00Z":170,"2020-02-26T00:00:00Z":189,"2020-02-27T00:00:00Z":214,"2020-02-28T00:00:00Z":228,"2020-02-29T00:00:00Z":241,"2020-03-01T00:00:00Z":256,"2020-03-02T00:00:00Z":274,"2020-03-03T00:00:00Z":293,"2020-03-04T00:00:00Z":331,"2020-03-05T00:00:00Z":360,"2020-03-06T00:00:00Z":420,"2020-03-07T00:00:00Z":461,"2020-03-08T00:00:00Z":502,"2020-03-09T00:00:00Z":511,"2020-03-10T00:00:00Z":581,"2020-03-11T00:00:00Z":639,"2020-03-12T00:00:00Z":639,"2020-03-13T00:00:00Z":701,"2020-03-14T00:00:00Z":773,"2020-03-15T00:00:00Z":839}},"recovered":{"latest":839,"timeline":{"2020-01-22T00:00:00Z":2,"2020-01-23T00:00:00Z":1,"2020-01-24T00:00:00Z":2,"2020-01-25T00:00:00Z":2,"2020-01-26T00:00:00Z":4,"2020-01-27T00:00:00Z":4,"2020-01-28T00:00:00Z":7,"2020-01-29T00:00:00Z":7,"2020-01-30T00:00:00Z":11,"2020-01-31T00:00:00Z":15,"2020-02-01T00:00:00Z":20,"2020-02-02T00:00:00Z":20,"2020-02-03T00:00:00Z":20,"2020-02-04T00:00:00Z":22,"2020-02-05T00:00:00Z":22,"2020-02-06T00:00:00Z":45,"2020-02-07T00:00:00Z":25,"2020-02-08T00:00:00Z":25,"2020-02-09T00:00:00Z":26,"2020-02-10T00:00:00Z":26,"2020-02-11T00:00:00Z":26,"2020-02-12T00:00:00Z":28,"2020-02-13T00:00:00Z":28,"2020-02-14T00:00:00Z":29,"2020-02-15T00:00:00Z":43,"2020-02-16T00:00:00Z":59,"2020-02-17T00:00:00Z":66,"2020-02-18T00:00:00Z":74,"2020-02-19T00:00:00Z":84,"2020-02-20T00:00:00Z":94,"2020-02-21T00:00:00Z":105,"2020-02-22T00:00:00Z":122,"2020-02-23T00:00:00Z":147,"2020-02-24T00:00:00Z":159,"2020-02-25T00:00:00Z":170,"2020-02-26T00:00:00Z":189,"2020-02-27T00:00:00Z":214,"2020-02-28T00:00:00Z":228,"2020-02-29T00:00:00Z":241,"2020-03-01T00:00:00Z":256,"2020-03-02T00:00:00Z":274,"2020-03-03T00:00:00Z":293,"2020-03-04T00:00:00Z":331,"2020-03-05T00:00:00Z":360,"2020-03-06T00:00:00Z":420,"2020-03-07T00:00:00Z":461,"2020-03-08T00:00:00Z":502,"2020-03-09T00:00:00Z":511,"2020-03-10T00:00:00Z":581,"2020-03-11T00:00:00Z":639,"2020-03-12T00:00:00Z":639,"2020-03-13T00:00:00Z":701,"2020-03-14T00:00:00Z":773,"2020-03-15T00:00:00Z":839}}}}} +{ + "location":{ + "coordinates":{ + "latitude":"36", + "longitude":"138" + }, + "country":"Japan", + "country_code":"JP", + "id":1, + "latest":{ + "confirmed":839, + "deaths":839, + "recovered":839 + }, + "province":"", + "timelines":{ + "confirmed":{ + "latest":839, + "timeline":{ + "2020-01-22T00:00:00Z":2, + "2020-01-23T00:00:00Z":1, + "2020-01-24T00:00:00Z":2, + "2020-01-25T00:00:00Z":2, + "2020-01-26T00:00:00Z":4, + "2020-01-27T00:00:00Z":4, + "2020-01-28T00:00:00Z":7, + "2020-01-29T00:00:00Z":7, + "2020-01-30T00:00:00Z":11, + "2020-01-31T00:00:00Z":15, + "2020-02-01T00:00:00Z":20, + "2020-02-02T00:00:00Z":20, + "2020-02-03T00:00:00Z":20, + "2020-02-04T00:00:00Z":22, + "2020-02-05T00:00:00Z":22, + "2020-02-06T00:00:00Z":45, + "2020-02-07T00:00:00Z":25, + "2020-02-08T00:00:00Z":25, + "2020-02-09T00:00:00Z":26, + "2020-02-10T00:00:00Z":26, + "2020-02-11T00:00:00Z":26, + "2020-02-12T00:00:00Z":28, + "2020-02-13T00:00:00Z":28, + "2020-02-14T00:00:00Z":29, + "2020-02-15T00:00:00Z":43, + "2020-02-16T00:00:00Z":59, + "2020-02-17T00:00:00Z":66, + "2020-02-18T00:00:00Z":74, + "2020-02-19T00:00:00Z":84, + "2020-02-20T00:00:00Z":94, + "2020-02-21T00:00:00Z":105, + "2020-02-22T00:00:00Z":122, + "2020-02-23T00:00:00Z":147, + "2020-02-24T00:00:00Z":159, + "2020-02-25T00:00:00Z":170, + "2020-02-26T00:00:00Z":189, + "2020-02-27T00:00:00Z":214, + "2020-02-28T00:00:00Z":228, + "2020-02-29T00:00:00Z":241, + "2020-03-01T00:00:00Z":256, + "2020-03-02T00:00:00Z":274, + "2020-03-03T00:00:00Z":293, + "2020-03-04T00:00:00Z":331, + "2020-03-05T00:00:00Z":360, + "2020-03-06T00:00:00Z":420, + "2020-03-07T00:00:00Z":461, + "2020-03-08T00:00:00Z":502, + "2020-03-09T00:00:00Z":511, + "2020-03-10T00:00:00Z":581, + "2020-03-11T00:00:00Z":639, + "2020-03-12T00:00:00Z":639, + "2020-03-13T00:00:00Z":701, + "2020-03-14T00:00:00Z":773, + "2020-03-15T00:00:00Z":839 + } + }, + "deaths":{ + "latest":839, + "timeline":{ + "2020-01-22T00:00:00Z":2, + "2020-01-23T00:00:00Z":1, + "2020-01-24T00:00:00Z":2, + "2020-01-25T00:00:00Z":2, + "2020-01-26T00:00:00Z":4, + "2020-01-27T00:00:00Z":4, + "2020-01-28T00:00:00Z":7, + "2020-01-29T00:00:00Z":7, + "2020-01-30T00:00:00Z":11, + "2020-01-31T00:00:00Z":15, + "2020-02-01T00:00:00Z":20, + "2020-02-02T00:00:00Z":20, + "2020-02-03T00:00:00Z":20, + "2020-02-04T00:00:00Z":22, + "2020-02-05T00:00:00Z":22, + "2020-02-06T00:00:00Z":45, + "2020-02-07T00:00:00Z":25, + "2020-02-08T00:00:00Z":25, + "2020-02-09T00:00:00Z":26, + "2020-02-10T00:00:00Z":26, + "2020-02-11T00:00:00Z":26, + "2020-02-12T00:00:00Z":28, + "2020-02-13T00:00:00Z":28, + "2020-02-14T00:00:00Z":29, + "2020-02-15T00:00:00Z":43, + "2020-02-16T00:00:00Z":59, + "2020-02-17T00:00:00Z":66, + "2020-02-18T00:00:00Z":74, + "2020-02-19T00:00:00Z":84, + "2020-02-20T00:00:00Z":94, + "2020-02-21T00:00:00Z":105, + "2020-02-22T00:00:00Z":122, + "2020-02-23T00:00:00Z":147, + "2020-02-24T00:00:00Z":159, + "2020-02-25T00:00:00Z":170, + "2020-02-26T00:00:00Z":189, + "2020-02-27T00:00:00Z":214, + "2020-02-28T00:00:00Z":228, + "2020-02-29T00:00:00Z":241, + "2020-03-01T00:00:00Z":256, + "2020-03-02T00:00:00Z":274, + "2020-03-03T00:00:00Z":293, + "2020-03-04T00:00:00Z":331, + "2020-03-05T00:00:00Z":360, + "2020-03-06T00:00:00Z":420, + "2020-03-07T00:00:00Z":461, + "2020-03-08T00:00:00Z":502, + "2020-03-09T00:00:00Z":511, + "2020-03-10T00:00:00Z":581, + "2020-03-11T00:00:00Z":639, + "2020-03-12T00:00:00Z":639, + "2020-03-13T00:00:00Z":701, + "2020-03-14T00:00:00Z":773, + "2020-03-15T00:00:00Z":839 + } + }, + "recovered":{ + "latest":839, + "timeline":{ + "2020-01-22T00:00:00Z":2, + "2020-01-23T00:00:00Z":1, + "2020-01-24T00:00:00Z":2, + "2020-01-25T00:00:00Z":2, + "2020-01-26T00:00:00Z":4, + "2020-01-27T00:00:00Z":4, + "2020-01-28T00:00:00Z":7, + "2020-01-29T00:00:00Z":7, + "2020-01-30T00:00:00Z":11, + "2020-01-31T00:00:00Z":15, + "2020-02-01T00:00:00Z":20, + "2020-02-02T00:00:00Z":20, + "2020-02-03T00:00:00Z":20, + "2020-02-04T00:00:00Z":22, + "2020-02-05T00:00:00Z":22, + "2020-02-06T00:00:00Z":45, + "2020-02-07T00:00:00Z":25, + "2020-02-08T00:00:00Z":25, + "2020-02-09T00:00:00Z":26, + "2020-02-10T00:00:00Z":26, + "2020-02-11T00:00:00Z":26, + "2020-02-12T00:00:00Z":28, + "2020-02-13T00:00:00Z":28, + "2020-02-14T00:00:00Z":29, + "2020-02-15T00:00:00Z":43, + "2020-02-16T00:00:00Z":59, + "2020-02-17T00:00:00Z":66, + "2020-02-18T00:00:00Z":74, + "2020-02-19T00:00:00Z":84, + "2020-02-20T00:00:00Z":94, + "2020-02-21T00:00:00Z":105, + "2020-02-22T00:00:00Z":122, + "2020-02-23T00:00:00Z":147, + "2020-02-24T00:00:00Z":159, + "2020-02-25T00:00:00Z":170, + "2020-02-26T00:00:00Z":189, + "2020-02-27T00:00:00Z":214, + "2020-02-28T00:00:00Z":228, + "2020-02-29T00:00:00Z":241, + "2020-03-01T00:00:00Z":256, + "2020-03-02T00:00:00Z":274, + "2020-03-03T00:00:00Z":293, + "2020-03-04T00:00:00Z":331, + "2020-03-05T00:00:00Z":360, + "2020-03-06T00:00:00Z":420, + "2020-03-07T00:00:00Z":461, + "2020-03-08T00:00:00Z":502, + "2020-03-09T00:00:00Z":511, + "2020-03-10T00:00:00Z":581, + "2020-03-11T00:00:00Z":639, + "2020-03-12T00:00:00Z":639, + "2020-03-13T00:00:00Z":701, + "2020-03-14T00:00:00Z":773, + "2020-03-15T00:00:00Z":839 + } + } + } + } +} From dd7b4a9366fb7722869bfbd53b0875df710be163 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Thu, 26 Mar 2020 21:40:17 +0100 Subject: [PATCH 3/5] Add continent code(s) assignment --- app/location/__init__.py | 20 +- app/models/location.py | 1 + app/router/locations.py | 1 + app/services/location/jhu.py | 7 +- app/utils/continents.py | 311 ++++++++++++++++++++++++ app/utils/countries.py | 12 +- tests/expected_output/v1_all.json | 29 +++ tests/expected_output/v1_confirmed.json | 10 + tests/expected_output/v1_deaths.json | 10 + tests/expected_output/v1_recovered.json | 6 + tests/expected_output/v2_locations.json | 10 + tests/test_continents.py | 26 ++ tests/test_location.py | 10 +- tests/test_routes.py | 2 +- 14 files changed, 439 insertions(+), 16 deletions(-) create mode 100644 app/utils/continents.py create mode 100644 tests/test_continents.py diff --git a/app/location/__init__.py b/app/location/__init__.py index 4782fddb..d21d0dbe 100644 --- a/app/location/__init__.py +++ b/app/location/__init__.py @@ -1,5 +1,5 @@ from ..coordinates import Coordinates -from ..utils import countries +from ..utils import countries, continents from ..utils.populations import country_population @@ -26,12 +26,25 @@ def __init__(self, id, country, province, coordinates, last_updated, confirmed, @property def country_code(self): """ - Gets the alpha-2 code represention of the country. Returns 'XX' if none is found. + Gets the alpha-2 code representation of the country. Returns 'XX' if none is found. :returns: The country code. :rtype: str """ - return (countries.country_code(self.country) or countries.default_country_code).upper() + return countries.country_code(self.country) or countries.default_country_code + + @property + def continent_codes_list(self): + """ + Gets the alpha-3 code representations of the continent codes where the + country represented by the country code is located. Returns 'CCC' if + none is found. + + :returns: The list of continent codes. + :rtype: list + """ + country_code = countries.country_code(self.country) + return continents.continent_codes_list(country_code) or continents.default_continent_codes_list @property def country_population(self): @@ -55,6 +68,7 @@ def serialize(self): "id": self.id, "country": self.country, "country_code": self.country_code, + "continent_codes_list": self.continent_codes_list, "country_population": self.country_population, "province": self.province, # Coordinates. diff --git a/app/models/location.py b/app/models/location.py index 48fa4d74..349f8936 100644 --- a/app/models/location.py +++ b/app/models/location.py @@ -14,6 +14,7 @@ class Location(BaseModel): id: int country: str country_code: str + continent_codes_list: list = [] country_population: int = None province: str = "" county: str = "" diff --git a/app/router/locations.py b/app/router/locations.py index af4b1cfd..ae135c6d 100644 --- a/app/router/locations.py +++ b/app/router/locations.py @@ -11,6 +11,7 @@ def get_locations( request: Request, source: Sources = "jhu", country_code: str = None, + continent_codes_list: list = [], province: str = None, county: str = None, timelines: bool = False, diff --git a/app/services/location/jhu.py b/app/services/location/jhu.py index ef99dddc..a6ea89b4 100644 --- a/app/services/location/jhu.py +++ b/app/services/location/jhu.py @@ -7,7 +7,7 @@ from ...coordinates import Coordinates from ...location import TimelinedLocation from ...timeline import Timeline -from ...utils import countries +from ...utils import countries, continents from ...utils import date as date_util from . import LocationService @@ -75,12 +75,15 @@ def get_category(category): # Latest data insert value. latest = list(history.values())[-1] + country_code = countries.country_code(country) + # Normalize the item and append to locations. locations.append( { # General info. "country": country, - "country_code": countries.country_code(country), + "country_code": country_code, + "continent_codes_list" : continents.continent_codes_list(country_code), "province": item["Province/State"], # Coordinates. "coordinates": {"lat": item["Lat"], "long": item["Long"],}, diff --git a/app/utils/continents.py b/app/utils/continents.py new file mode 100644 index 00000000..abefd944 --- /dev/null +++ b/app/utils/continents.py @@ -0,0 +1,311 @@ +import logging +from itertools import chain +from . import countries + +LOGGER = logging.getLogger(__name__) + +default_continent_codes_list = ["CCC"] + +continent_names__continent_codes = { + "Africa" : "AFR", + "North America" : "NAC", # "NAM" clashes with "Namibia" + "Oceania" : "OCE", + "Antarctica" : "ANA", # "ANT" clashes with "Netherlands Antilles" + "Asia" : "ASI", + "Europe" : "EUR", + "South America" : "SAC", + "Others" : default_continent_codes_list[0], + } + +country_code__continent_codes_list = { + "AF" : ["ASI"], + "XK" : ["EUR"], + "AL" : ["EUR"], + "AQ" : ["ANA"], + "DZ" : ["AFR"], + "AS" : ["OCE"], + "AD" : ["EUR"], + "AO" : ["AFR"], + "AG" : ["NAC"], + "AZ" : ["EUR", "ASI"], + "AR" : ["SAC"], + "AU" : ["OCE"], + "AT" : ["EUR"], + "BS" : ["NAC"], + "BH" : ["ASI"], + "BD" : ["ASI"], + "AM" : ["EUR", "ASI"], + "BB" : ["NAC"], + "BE" : ["EUR"], + "BM" : ["NAC"], + "BT" : ["ASI"], + "BO" : ["SAC"], + "BA" : ["EUR"], + "BW" : ["AFR"], + "BV" : ["ANA"], + "BR" : ["SAC"], + "BZ" : ["NAC"], + "IO" : ["ASI"], + "SB" : ["OCE"], + "VG" : ["NAC"], + "BN" : ["ASI"], + "BG" : ["EUR"], + "MM" : ["ASI"], + "BI" : ["AFR"], + "BY" : ["EUR"], + "KH" : ["ASI"], + "CM" : ["AFR"], + "CA" : ["NAC"], + "CV" : ["AFR"], + "KY" : ["NAC"], + "CF" : ["AFR"], + "LK" : ["ASI"], + "TD" : ["AFR"], + "CL" : ["SAC"], + "CN" : ["ASI"], + "TW" : ["ASI"], + "CX" : ["ASI"], + "CC" : ["ASI"], + "CO" : ["SAC"], + "KM" : ["AFR"], + "YT" : ["AFR"], + "CG" : ["AFR"], + "CD" : ["AFR"], + "CK" : ["OCE"], + "CR" : ["NAC"], + "HR" : ["EUR"], + "CU" : ["NAC"], + "CY" : ["EUR", "ASI"], + "CZ" : ["EUR"], + "BJ" : ["AFR"], + "DK" : ["EUR"], + "DM" : ["NAC"], + "DO" : ["NAC"], + "EC" : ["SAC"], + "SV" : ["NAC"], + "GQ" : ["AFR"], + "ET" : ["AFR"], + "ER" : ["AFR"], + "EE" : ["EUR"], + "FO" : ["EUR"], + "FK" : ["SAC"], + "GS" : ["ANA"], + "FJ" : ["OCE"], + "FI" : ["EUR"], + "AX" : ["EUR"], + "FR" : ["EUR"], + "GF" : ["SAC"], + "PF" : ["OCE"], + "TF" : ["ANA"], + "DJ" : ["AFR"], + "GA" : ["AFR"], + "GE" : ["EUR", "ASI"], + "GM" : ["AFR"], + "DE" : ["EUR"], + "GH" : ["AFR"], + "GI" : ["EUR"], + "KI" : ["OCE"], + "GR" : ["EUR"], + "GL" : ["NAC"], + "GD" : ["NAC"], + "GP" : ["NAC"], + "GU" : ["OCE"], + "GT" : ["NAC"], + "GN" : ["AFR"], + "GY" : ["SAC"], + "HT" : ["NAC"], + "HM" : ["ANA"], + "VA" : ["EUR"], + "HN" : ["NAC"], + "HK" : ["ASI"], + "HU" : ["EUR"], + "IS" : ["EUR"], + "IN" : ["ASI"], + "ID" : ["ASI"], + "IR" : ["ASI"], + "IQ" : ["ASI"], + "IE" : ["EUR"], + "IL" : ["ASI"], + "IT" : ["EUR"], + "CI" : ["AFR"], + "JM" : ["NAC"], + "JP" : ["ASI"], + "KZ" : ["EUR", "ASI"], + "JO" : ["ASI"], + "KE" : ["AFR"], + "KP" : ["ASI"], + "KR" : ["ASI"], + "KW" : ["ASI"], + "KG" : ["ASI"], + "LA" : ["ASI"], + "LB" : ["ASI"], + "LS" : ["AFR"], + "LV" : ["EUR"], + "LR" : ["AFR"], + "LY" : ["AFR"], + "LI" : ["EUR"], + "LT" : ["EUR"], + "LU" : ["EUR"], + "MO" : ["ASI"], + "MG" : ["AFR"], + "MW" : ["AFR"], + "MY" : ["ASI"], + "MV" : ["ASI"], + "ML" : ["AFR"], + "MT" : ["EUR"], + "MQ" : ["NAC"], + "MR" : ["AFR"], + "MU" : ["AFR"], + "MX" : ["NAC"], + "MC" : ["EUR"], + "MN" : ["ASI"], + "MD" : ["EUR"], + "ME" : ["EUR"], + "MS" : ["NAC"], + "MA" : ["AFR"], + "MZ" : ["AFR"], + "OM" : ["ASI"], + "NA" : ["AFR"], + "NR" : ["OCE"], + "NP" : ["ASI"], + "NL" : ["EUR"], + "AN" : ["NAC"], + "CW" : ["NAC"], + "AW" : ["NAC"], + "SX" : ["NAC"], + "BQ" : ["NAC"], + "NC" : ["OCE"], + "VU" : ["OCE"], + "NZ" : ["OCE"], + "NI" : ["NAC"], + "NE" : ["AFR"], + "NG" : ["AFR"], + "NU" : ["OCE"], + "NF" : ["OCE"], + "NO" : ["EUR"], + "MP" : ["OCE"], + "UM" : ["OCE", "NAC"], + "FM" : ["OCE"], + "MH" : ["OCE"], + "PW" : ["OCE"], + "PK" : ["ASI"], + "PS" : ["ASI"], + "PA" : ["NAC"], + "PG" : ["OCE"], + "PY" : ["SAC"], + "PE" : ["SAC"], + "PH" : ["ASI"], + "PN" : ["OCE"], + "PL" : ["EUR"], + "PT" : ["EUR"], + "GW" : ["AFR"], + "TL" : ["ASI"], + "PR" : ["NAC"], + "QA" : ["ASI"], + "RE" : ["AFR"], + "RO" : ["EUR"], + "RU" : ["EUR", "ASI"], + "RW" : ["AFR"], + "BL" : ["NAC"], + "SH" : ["AFR"], + "KN" : ["NAC"], + "AI" : ["NAC"], + "LC" : ["NAC"], + "MF" : ["NAC"], + "PM" : ["NAC"], + "VC" : ["NAC"], + "SM" : ["EUR"], + "ST" : ["AFR"], + "SA" : ["ASI"], + "SN" : ["AFR"], + "RS" : ["EUR"], + "SC" : ["AFR"], + "SL" : ["AFR"], + "SG" : ["ASI"], + "SK" : ["EUR"], + "VN" : ["ASI"], + "SI" : ["EUR"], + "SO" : ["AFR"], + "ZA" : ["AFR"], + "ZW" : ["AFR"], + "ES" : ["EUR"], + "SS" : ["AFR"], + "SD" : ["AFR"], + "EH" : ["AFR"], + "SR" : ["SAC"], + "SJ" : ["EUR"], + "SZ" : ["AFR"], + "SE" : ["EUR"], + "CH" : ["EUR"], + "SY" : ["ASI"], + "TJ" : ["ASI"], + "TH" : ["ASI"], + "TG" : ["AFR"], + "TK" : ["OCE"], + "TO" : ["OCE"], + "TT" : ["NAC"], + "AE" : ["ASI"], + "TN" : ["AFR"], + "TR" : ["EUR", "ASI"], + "TM" : ["ASI"], + "TC" : ["NAC"], + "TV" : ["OCE"], + "UG" : ["AFR"], + "UA" : ["EUR"], + "MK" : ["EUR"], + "EG" : ["AFR"], + "GB" : ["EUR"], + "GG" : ["EUR"], + "JE" : ["EUR"], + "IM" : ["EUR"], + "TZ" : ["AFR"], + "US" : ["NAC"], + "VI" : ["NAC"], + "BF" : ["AFR"], + "UY" : ["SAC"], + "UZ" : ["ASI"], + "VE" : ["SAC"], + "WF" : ["OCE"], + "WS" : ["OCE"], + "YE" : ["ASI"], + "ZM" : ["AFR"], + "XD" : ["ASI"], + "XE" : ["ASI"], + "XS" : ["ASI"], + # TODO "XX - Disputed Territory" conflicts with `default_country_code` + # "XX" : ["OCE"], + countries.default_country_code : default_continent_codes_list, +} + +def continent_codes_list(s): + """ + Return a list(!) of three letter continent codes (Alpha-3) inspired + by https://datahub.io/core/continent-codes#resource-continent-codes. + (We could not find any relevant ISO norm) + Defaults to ["CCC"]. + + As of now (March 2020) following countries are located on more than one + continent: + + OCE - Oceania and NAC - North America: + UM - United States Minor Outlying Islands + + EUR - Europe and ASI - Asia: + RU - Russian Federation + AM - Armenia + GE - Georgia + CY - Cyprus + TR - Turkey + KZ - Kazakhstan + AZ - Azerbaijan + """ + codes = country_code__continent_codes_list.get(s, default_continent_codes_list) + if codes == default_continent_codes_list: + # TODO probably would be better to return an empty list or even better + # to create a union type `CountryCode` so that any misspelled country + # code would lead to a type error (thrown early on, so it could be + # dealt with early on too) + LOGGER.warning(f"No list of continent codes found for '{s}'. "+ + f"Using '{codes}'!") + + return codes diff --git a/app/utils/countries.py b/app/utils/countries.py index 6647e679..0f7f2710 100644 --- a/app/utils/countries.py +++ b/app/utils/countries.py @@ -365,11 +365,11 @@ # fmt: on def country_code(s): """ - Return two letter country code (Alpha-2) according to https://en.wikipedia.org/wiki/ISO_3166-1 - Defaults to "XX". + Return two letter country code (Alpha-2) according to + https://en.wikipedia.org/wiki/ISO_3166-1 Defaults to "XX". """ - country_code = country_name__country_code.get(s, default_country_code) - if country_code == default_country_code: - LOGGER.warning(f"No country code found for '{s}'. Using '{country_code}'!") + code = country_name__country_code.get(s, default_country_code) + if code == default_country_code: + LOGGER.warning(f"No country code found for '{s}'. Using '{code}'!") - return country_code + return code diff --git a/tests/expected_output/v1_all.json b/tests/expected_output/v1_all.json index 49bd82c8..da4bc387 100644 --- a/tests/expected_output/v1_all.json +++ b/tests/expected_output/v1_all.json @@ -10,6 +10,7 @@ }, "country":"Thailand", "country_code":"TH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":3, @@ -76,6 +77,7 @@ }, "country":"Japan", "country_code":"JP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":1, @@ -142,6 +144,7 @@ }, "country":"Singapore", "country_code":"SG", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":1, @@ -208,6 +211,7 @@ }, "country":"Nepal", "country_code":"NP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -274,6 +278,7 @@ }, "country":"Malaysia", "country_code":"MY", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -340,6 +345,7 @@ }, "country":"Canada", "country_code":"CA", + "continent_codes_list":["NAC"], "history":{ "1/22/20":0, "1/23/20":0, @@ -406,6 +412,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -472,6 +479,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -538,6 +546,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -604,6 +613,7 @@ }, "country":"Cambodia", "country_code":"KH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -677,6 +687,7 @@ }, "country":"Thailand", "country_code":"TH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":3, @@ -743,6 +754,7 @@ }, "country":"Japan", "country_code":"JP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":1, @@ -809,6 +821,7 @@ }, "country":"Singapore", "country_code":"SG", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":1, @@ -875,6 +888,7 @@ }, "country":"Nepal", "country_code":"NP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -941,6 +955,7 @@ }, "country":"Malaysia", "country_code":"MY", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1007,6 +1022,7 @@ }, "country":"Canada", "country_code":"CA", + "continent_codes_list":["NAC"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1073,6 +1089,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1139,6 +1156,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1205,6 +1223,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1271,6 +1290,7 @@ }, "country":"Cambodia", "country_code":"KH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1349,6 +1369,7 @@ }, "country":"Thailand", "country_code":"TH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":3, @@ -1415,6 +1436,7 @@ }, "country":"Japan", "country_code":"JP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":1, @@ -1481,6 +1503,7 @@ }, "country":"Singapore", "country_code":"SG", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":1, @@ -1547,6 +1570,7 @@ }, "country":"Nepal", "country_code":"NP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1613,6 +1637,7 @@ }, "country":"Malaysia", "country_code":"MY", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1679,6 +1704,7 @@ }, "country":"Canada", "country_code":"CA", + "continent_codes_list":["NAC"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1745,6 +1771,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1811,6 +1838,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -1877,6 +1905,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, diff --git a/tests/expected_output/v1_confirmed.json b/tests/expected_output/v1_confirmed.json index 6dc57d57..3da2115d 100644 --- a/tests/expected_output/v1_confirmed.json +++ b/tests/expected_output/v1_confirmed.json @@ -9,6 +9,7 @@ }, "country":"Thailand", "country_code":"TH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":3, @@ -75,6 +76,7 @@ }, "country":"Japan", "country_code":"JP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":1, @@ -141,6 +143,7 @@ }, "country":"Singapore", "country_code":"SG", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":1, @@ -207,6 +210,7 @@ }, "country":"Nepal", "country_code":"NP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -273,6 +277,7 @@ }, "country":"Malaysia", "country_code":"MY", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -339,6 +344,7 @@ }, "country":"Canada", "country_code":"CA", + "continent_codes_list":["NAC"], "history":{ "1/22/20":0, "1/23/20":0, @@ -405,6 +411,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -471,6 +478,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -537,6 +545,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -603,6 +612,7 @@ }, "country":"Cambodia", "country_code":"KH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, diff --git a/tests/expected_output/v1_deaths.json b/tests/expected_output/v1_deaths.json index 6dc57d57..3da2115d 100644 --- a/tests/expected_output/v1_deaths.json +++ b/tests/expected_output/v1_deaths.json @@ -9,6 +9,7 @@ }, "country":"Thailand", "country_code":"TH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":3, @@ -75,6 +76,7 @@ }, "country":"Japan", "country_code":"JP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":1, @@ -141,6 +143,7 @@ }, "country":"Singapore", "country_code":"SG", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":1, @@ -207,6 +210,7 @@ }, "country":"Nepal", "country_code":"NP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -273,6 +277,7 @@ }, "country":"Malaysia", "country_code":"MY", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -339,6 +344,7 @@ }, "country":"Canada", "country_code":"CA", + "continent_codes_list":["NAC"], "history":{ "1/22/20":0, "1/23/20":0, @@ -405,6 +411,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -471,6 +478,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -537,6 +545,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "history":{ "1/22/20":0, "1/23/20":0, @@ -603,6 +612,7 @@ }, "country":"Cambodia", "country_code":"KH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, diff --git a/tests/expected_output/v1_recovered.json b/tests/expected_output/v1_recovered.json index 44669db7..3da2115d 100644 --- a/tests/expected_output/v1_recovered.json +++ b/tests/expected_output/v1_recovered.json @@ -9,6 +9,7 @@ }, "country":"Thailand", "country_code":"TH", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":3, @@ -75,6 +76,7 @@ }, "country":"Japan", "country_code":"JP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":2, "1/23/20":1, @@ -141,6 +143,7 @@ }, "country":"Singapore", "country_code":"SG", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":1, @@ -207,6 +210,7 @@ }, "country":"Nepal", "country_code":"NP", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -273,6 +277,7 @@ }, "country":"Malaysia", "country_code":"MY", + "continent_codes_list":["ASI"], "history":{ "1/22/20":0, "1/23/20":0, @@ -339,6 +344,7 @@ }, "country":"Canada", "country_code":"CA", + "continent_codes_list":["NAC"], "history":{ "1/22/20":0, "1/23/20":0, diff --git a/tests/expected_output/v2_locations.json b/tests/expected_output/v2_locations.json index 00a40a74..baef843a 100644 --- a/tests/expected_output/v2_locations.json +++ b/tests/expected_output/v2_locations.json @@ -7,6 +7,7 @@ }, "country":"Thailand", "country_code":"TH", + "continent_codes_list":["ASI"], "id":0, "latest":{ "confirmed":114, @@ -22,6 +23,7 @@ }, "country":"Japan", "country_code":"JP", + "continent_codes_list":["ASI"], "id":1, "latest":{ "confirmed":839, @@ -37,6 +39,7 @@ }, "country":"Singapore", "country_code":"SG", + "continent_codes_list":["ASI"], "id":2, "latest":{ "confirmed":226, @@ -52,6 +55,7 @@ }, "country":"Nepal", "country_code":"NP", + "continent_codes_list":["ASI"], "id":3, "latest":{ "confirmed":1, @@ -67,6 +71,7 @@ }, "country":"Malaysia", "country_code":"MY", + "continent_codes_list":["ASI"], "id":4, "latest":{ "confirmed":428, @@ -82,6 +87,7 @@ }, "country":"Canada", "country_code":"CA", + "continent_codes_list":["NAC"], "id":5, "latest":{ "confirmed":73, @@ -97,6 +103,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "id":6, "latest":{ "confirmed":134, @@ -112,6 +119,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "id":7, "latest":{ "confirmed":57, @@ -127,6 +135,7 @@ }, "country":"Australia", "country_code":"AU", + "continent_codes_list":["OCE"], "id":8, "latest":{ "confirmed":61, @@ -142,6 +151,7 @@ }, "country":"Cambodia", "country_code":"KH", + "continent_codes_list":["ASI"], "id":9, "latest":{ "confirmed":7, diff --git a/tests/test_continents.py b/tests/test_continents.py new file mode 100644 index 00000000..e98d8017 --- /dev/null +++ b/tests/test_continents.py @@ -0,0 +1,26 @@ +import pytest + +from app.utils import continents, countries + +@pytest.mark.parametrize( + "country_name,expected_continent_codes_list", + [ + ("Germany", ["EUR"]), + ("Bolivia, Plurinational State of", ["SAC"]), + ("Korea, Democratic People's Republic of", ["ASI"]), + ("BlaBla", ["CCC"]), + ("United States Minor Outlying Islands", ["OCE", "NAC"]), + ("Russian Federation", ["EUR", "ASI"]), + ("Armenia", ["EUR", "ASI"]), + ("Georgia", ["EUR", "ASI"]), + ("Cyprus", ["EUR", "ASI"]), + ("Turkey", ["EUR", "ASI"]), + ("Kazakhstan", ["EUR", "ASI"]), + ("Azerbaijan", ["EUR", "ASI"]), + (" Azerbaijan", ["EUR", "ASI"]), + ], +) +def test_country_name__continent_codes_list(country_name, expected_continent_codes_list): + country_code = countries.country_code(country_name) + continent_codes_list = continents.continent_codes_list(country_code) + assert continent_codes_list == expected_continent_codes_list diff --git a/tests/test_location.py b/tests/test_location.py index 567eddcd..1406686a 100644 --- a/tests/test_location.py +++ b/tests/test_location.py @@ -15,11 +15,11 @@ def __init__(self, latest): @pytest.mark.parametrize( - "test_id, country, country_code, province, latitude, longitude, confirmed_latest, deaths_latest, recovered_latest", + "test_id, country, country_code, continent_codes_list, province, latitude, longitude, confirmed_latest, deaths_latest, recovered_latest", [ - (0, "Thailand", "TH", "", 15, 100, 1000, 1111, 22222), - (1, "Deutschland", "DE", "", 15, 100, 1000, 1111, 22222), - (2, "Cruise Ship", "XX", "", 15, 100, 1000, 1111, 22222), + (0, "Thailand", "TH", ["ASI"], "", 15, 100, 1000, 1111, 22222), + (1, "Deutschland", "DE", ["EUR"], "", 15, 100, 1000, 1111, 22222), + (2, "Cruise Ship", "XX", ["CCC"], "", 15, 100, 1000, 1111, 22222), ], ) @mock.patch("app.timeline.Timeline", side_effect=mocked_timeline) @@ -28,6 +28,7 @@ def test_location_class( test_id, country, country_code, + continent_codes_list, province, latitude, longitude, @@ -52,4 +53,5 @@ def test_location_class( ) assert location_obj.country_code == country_code + assert location_obj.continent_codes_list == continent_codes_list assert not location_obj.serialize() == None diff --git a/tests/test_routes.py b/tests/test_routes.py index e9a795bd..c77535b6 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -131,7 +131,7 @@ def tearDown(self): ({"timelines": 1}, 200), ({"source": "jhu", "timelines": True}, 200), ({"source": "csbs", "country_code": "US"}, 200), - ({"source": "jhu", "country_code": "US"}, 404), + ({"source": "jhu", "country_code": "US"}, 404), ], ) def test_locations_status_code(api_client, query_params, expected_status): From 192fd646b810c2a335e6b03bce9c215b14344de3 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Thu, 26 Mar 2020 02:06:41 +0100 Subject: [PATCH 4/5] Document continent_codes_list in the README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 72a30c6a..01543c52 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ __Sample response__ "id": 39, "country": "Norway", "country_code": "NO", + "continent_codes_list": ["EUR"], "country_population": 5009150, "province": "", "county": "", @@ -175,6 +176,7 @@ __Sample response__ "id": 0, "country": "Thailand", "country_code": "TH", + "continent_codes_list": ["ASI"], "country_population": 67089500, "province": "", "county": "", @@ -192,6 +194,7 @@ __Sample response__ { "id": 39, "country": "Norway", + "continent_codes_list": ["EUR"], "country_code": "NO", "province": "", "county": "", @@ -254,6 +257,7 @@ __Sample Response__ "id": 16, "country": "Italy", "country_code": "IT", + "continent_codes_list": ["EUR"], "country_population": 60340328, "province": "", "county": "", @@ -294,6 +298,7 @@ __Sample Response__ "id": 0, "country": "US", "country_code": "US", + "continent_codes_list": ["NAC"], "country_population": 310232863, "province": "New York", "state": "New York", @@ -313,6 +318,7 @@ __Sample Response__ "id": 1, "country": "US", "country_code": "US", + "continent_codes_list": ["NAC"], "country_population": 310232863, "province": "New York", "state": "New York", From eb471f7c1a8a8583b62d1f1f8e4a7eec29b3a16d Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Sat, 28 Mar 2020 00:26:19 +0100 Subject: [PATCH 5/5] Fix formatting and import order isort --recursive . --- app/location/__init__.py | 2 +- app/services/location/jhu.py | 4 +- app/utils/continents.py | 519 ++++++++++++++++++----------------- app/utils/countries.py | 1 - tests/test_continents.py | 4 +- tests/test_location.py | 2 +- tests/test_routes.py | 4 +- 7 files changed, 270 insertions(+), 266 deletions(-) diff --git a/app/location/__init__.py b/app/location/__init__.py index d21d0dbe..0672d65d 100644 --- a/app/location/__init__.py +++ b/app/location/__init__.py @@ -1,5 +1,5 @@ from ..coordinates import Coordinates -from ..utils import countries, continents +from ..utils import continents, countries from ..utils.populations import country_population diff --git a/app/services/location/jhu.py b/app/services/location/jhu.py index a6ea89b4..7271a477 100644 --- a/app/services/location/jhu.py +++ b/app/services/location/jhu.py @@ -7,7 +7,7 @@ from ...coordinates import Coordinates from ...location import TimelinedLocation from ...timeline import Timeline -from ...utils import countries, continents +from ...utils import continents, countries from ...utils import date as date_util from . import LocationService @@ -83,7 +83,7 @@ def get_category(category): # General info. "country": country, "country_code": country_code, - "continent_codes_list" : continents.continent_codes_list(country_code), + "continent_codes_list": continents.continent_codes_list(country_code), "province": item["Province/State"], # Coordinates. "coordinates": {"lat": item["Lat"], "long": item["Long"],}, diff --git a/app/utils/continents.py b/app/utils/continents.py index abefd944..ec3a1879 100644 --- a/app/utils/continents.py +++ b/app/utils/continents.py @@ -1,11 +1,13 @@ import logging from itertools import chain + from . import countries LOGGER = logging.getLogger(__name__) default_continent_codes_list = ["CCC"] +# fmt: off continent_names__continent_codes = { "Africa" : "AFR", "North America" : "NAC", # "NAM" clashes with "Namibia" @@ -18,265 +20,266 @@ } country_code__continent_codes_list = { - "AF" : ["ASI"], - "XK" : ["EUR"], - "AL" : ["EUR"], - "AQ" : ["ANA"], - "DZ" : ["AFR"], - "AS" : ["OCE"], - "AD" : ["EUR"], - "AO" : ["AFR"], - "AG" : ["NAC"], - "AZ" : ["EUR", "ASI"], - "AR" : ["SAC"], - "AU" : ["OCE"], - "AT" : ["EUR"], - "BS" : ["NAC"], - "BH" : ["ASI"], - "BD" : ["ASI"], - "AM" : ["EUR", "ASI"], - "BB" : ["NAC"], - "BE" : ["EUR"], - "BM" : ["NAC"], - "BT" : ["ASI"], - "BO" : ["SAC"], - "BA" : ["EUR"], - "BW" : ["AFR"], - "BV" : ["ANA"], - "BR" : ["SAC"], - "BZ" : ["NAC"], - "IO" : ["ASI"], - "SB" : ["OCE"], - "VG" : ["NAC"], - "BN" : ["ASI"], - "BG" : ["EUR"], - "MM" : ["ASI"], - "BI" : ["AFR"], - "BY" : ["EUR"], - "KH" : ["ASI"], - "CM" : ["AFR"], - "CA" : ["NAC"], - "CV" : ["AFR"], - "KY" : ["NAC"], - "CF" : ["AFR"], - "LK" : ["ASI"], - "TD" : ["AFR"], - "CL" : ["SAC"], - "CN" : ["ASI"], - "TW" : ["ASI"], - "CX" : ["ASI"], - "CC" : ["ASI"], - "CO" : ["SAC"], - "KM" : ["AFR"], - "YT" : ["AFR"], - "CG" : ["AFR"], - "CD" : ["AFR"], - "CK" : ["OCE"], - "CR" : ["NAC"], - "HR" : ["EUR"], - "CU" : ["NAC"], - "CY" : ["EUR", "ASI"], - "CZ" : ["EUR"], - "BJ" : ["AFR"], - "DK" : ["EUR"], - "DM" : ["NAC"], - "DO" : ["NAC"], - "EC" : ["SAC"], - "SV" : ["NAC"], - "GQ" : ["AFR"], - "ET" : ["AFR"], - "ER" : ["AFR"], - "EE" : ["EUR"], - "FO" : ["EUR"], - "FK" : ["SAC"], - "GS" : ["ANA"], - "FJ" : ["OCE"], - "FI" : ["EUR"], - "AX" : ["EUR"], - "FR" : ["EUR"], - "GF" : ["SAC"], - "PF" : ["OCE"], - "TF" : ["ANA"], - "DJ" : ["AFR"], - "GA" : ["AFR"], - "GE" : ["EUR", "ASI"], - "GM" : ["AFR"], - "DE" : ["EUR"], - "GH" : ["AFR"], - "GI" : ["EUR"], - "KI" : ["OCE"], - "GR" : ["EUR"], - "GL" : ["NAC"], - "GD" : ["NAC"], - "GP" : ["NAC"], - "GU" : ["OCE"], - "GT" : ["NAC"], - "GN" : ["AFR"], - "GY" : ["SAC"], - "HT" : ["NAC"], - "HM" : ["ANA"], - "VA" : ["EUR"], - "HN" : ["NAC"], - "HK" : ["ASI"], - "HU" : ["EUR"], - "IS" : ["EUR"], - "IN" : ["ASI"], - "ID" : ["ASI"], - "IR" : ["ASI"], - "IQ" : ["ASI"], - "IE" : ["EUR"], - "IL" : ["ASI"], - "IT" : ["EUR"], - "CI" : ["AFR"], - "JM" : ["NAC"], - "JP" : ["ASI"], - "KZ" : ["EUR", "ASI"], - "JO" : ["ASI"], - "KE" : ["AFR"], - "KP" : ["ASI"], - "KR" : ["ASI"], - "KW" : ["ASI"], - "KG" : ["ASI"], - "LA" : ["ASI"], - "LB" : ["ASI"], - "LS" : ["AFR"], - "LV" : ["EUR"], - "LR" : ["AFR"], - "LY" : ["AFR"], - "LI" : ["EUR"], - "LT" : ["EUR"], - "LU" : ["EUR"], - "MO" : ["ASI"], - "MG" : ["AFR"], - "MW" : ["AFR"], - "MY" : ["ASI"], - "MV" : ["ASI"], - "ML" : ["AFR"], - "MT" : ["EUR"], - "MQ" : ["NAC"], - "MR" : ["AFR"], - "MU" : ["AFR"], - "MX" : ["NAC"], - "MC" : ["EUR"], - "MN" : ["ASI"], - "MD" : ["EUR"], - "ME" : ["EUR"], - "MS" : ["NAC"], - "MA" : ["AFR"], - "MZ" : ["AFR"], - "OM" : ["ASI"], - "NA" : ["AFR"], - "NR" : ["OCE"], - "NP" : ["ASI"], - "NL" : ["EUR"], - "AN" : ["NAC"], - "CW" : ["NAC"], - "AW" : ["NAC"], - "SX" : ["NAC"], - "BQ" : ["NAC"], - "NC" : ["OCE"], - "VU" : ["OCE"], - "NZ" : ["OCE"], - "NI" : ["NAC"], - "NE" : ["AFR"], - "NG" : ["AFR"], - "NU" : ["OCE"], - "NF" : ["OCE"], - "NO" : ["EUR"], - "MP" : ["OCE"], - "UM" : ["OCE", "NAC"], - "FM" : ["OCE"], - "MH" : ["OCE"], - "PW" : ["OCE"], - "PK" : ["ASI"], - "PS" : ["ASI"], - "PA" : ["NAC"], - "PG" : ["OCE"], - "PY" : ["SAC"], - "PE" : ["SAC"], - "PH" : ["ASI"], - "PN" : ["OCE"], - "PL" : ["EUR"], - "PT" : ["EUR"], - "GW" : ["AFR"], - "TL" : ["ASI"], - "PR" : ["NAC"], - "QA" : ["ASI"], - "RE" : ["AFR"], - "RO" : ["EUR"], - "RU" : ["EUR", "ASI"], - "RW" : ["AFR"], - "BL" : ["NAC"], - "SH" : ["AFR"], - "KN" : ["NAC"], - "AI" : ["NAC"], - "LC" : ["NAC"], - "MF" : ["NAC"], - "PM" : ["NAC"], - "VC" : ["NAC"], - "SM" : ["EUR"], - "ST" : ["AFR"], - "SA" : ["ASI"], - "SN" : ["AFR"], - "RS" : ["EUR"], - "SC" : ["AFR"], - "SL" : ["AFR"], - "SG" : ["ASI"], - "SK" : ["EUR"], - "VN" : ["ASI"], - "SI" : ["EUR"], - "SO" : ["AFR"], - "ZA" : ["AFR"], - "ZW" : ["AFR"], - "ES" : ["EUR"], - "SS" : ["AFR"], - "SD" : ["AFR"], - "EH" : ["AFR"], - "SR" : ["SAC"], - "SJ" : ["EUR"], - "SZ" : ["AFR"], - "SE" : ["EUR"], - "CH" : ["EUR"], - "SY" : ["ASI"], - "TJ" : ["ASI"], - "TH" : ["ASI"], - "TG" : ["AFR"], - "TK" : ["OCE"], - "TO" : ["OCE"], - "TT" : ["NAC"], - "AE" : ["ASI"], - "TN" : ["AFR"], - "TR" : ["EUR", "ASI"], - "TM" : ["ASI"], - "TC" : ["NAC"], - "TV" : ["OCE"], - "UG" : ["AFR"], - "UA" : ["EUR"], - "MK" : ["EUR"], - "EG" : ["AFR"], - "GB" : ["EUR"], - "GG" : ["EUR"], - "JE" : ["EUR"], - "IM" : ["EUR"], - "TZ" : ["AFR"], - "US" : ["NAC"], - "VI" : ["NAC"], - "BF" : ["AFR"], - "UY" : ["SAC"], - "UZ" : ["ASI"], - "VE" : ["SAC"], - "WF" : ["OCE"], - "WS" : ["OCE"], - "YE" : ["ASI"], - "ZM" : ["AFR"], - "XD" : ["ASI"], - "XE" : ["ASI"], - "XS" : ["ASI"], + "AF": ["ASI"], + "XK": ["EUR"], + "AL": ["EUR"], + "AQ": ["ANA"], + "DZ": ["AFR"], + "AS": ["OCE"], + "AD": ["EUR"], + "AO": ["AFR"], + "AG": ["NAC"], + "AZ": ["EUR", "ASI"], + "AR": ["SAC"], + "AU": ["OCE"], + "AT": ["EUR"], + "BS": ["NAC"], + "BH": ["ASI"], + "BD": ["ASI"], + "AM": ["EUR", "ASI"], + "BB": ["NAC"], + "BE": ["EUR"], + "BM": ["NAC"], + "BT": ["ASI"], + "BO": ["SAC"], + "BA": ["EUR"], + "BW": ["AFR"], + "BV": ["ANA"], + "BR": ["SAC"], + "BZ": ["NAC"], + "IO": ["ASI"], + "SB": ["OCE"], + "VG": ["NAC"], + "BN": ["ASI"], + "BG": ["EUR"], + "MM": ["ASI"], + "BI": ["AFR"], + "BY": ["EUR"], + "KH": ["ASI"], + "CM": ["AFR"], + "CA": ["NAC"], + "CV": ["AFR"], + "KY": ["NAC"], + "CF": ["AFR"], + "LK": ["ASI"], + "TD": ["AFR"], + "CL": ["SAC"], + "CN": ["ASI"], + "TW": ["ASI"], + "CX": ["ASI"], + "CC": ["ASI"], + "CO": ["SAC"], + "KM": ["AFR"], + "YT": ["AFR"], + "CG": ["AFR"], + "CD": ["AFR"], + "CK": ["OCE"], + "CR": ["NAC"], + "HR": ["EUR"], + "CU": ["NAC"], + "CY": ["EUR", "ASI"], + "CZ": ["EUR"], + "BJ": ["AFR"], + "DK": ["EUR"], + "DM": ["NAC"], + "DO": ["NAC"], + "EC": ["SAC"], + "SV": ["NAC"], + "GQ": ["AFR"], + "ET": ["AFR"], + "ER": ["AFR"], + "EE": ["EUR"], + "FO": ["EUR"], + "FK": ["SAC"], + "GS": ["ANA"], + "FJ": ["OCE"], + "FI": ["EUR"], + "AX": ["EUR"], + "FR": ["EUR"], + "GF": ["SAC"], + "PF": ["OCE"], + "TF": ["ANA"], + "DJ": ["AFR"], + "GA": ["AFR"], + "GE": ["EUR", "ASI"], + "GM": ["AFR"], + "DE": ["EUR"], + "GH": ["AFR"], + "GI": ["EUR"], + "KI": ["OCE"], + "GR": ["EUR"], + "GL": ["NAC"], + "GD": ["NAC"], + "GP": ["NAC"], + "GU": ["OCE"], + "GT": ["NAC"], + "GN": ["AFR"], + "GY": ["SAC"], + "HT": ["NAC"], + "HM": ["ANA"], + "VA": ["EUR"], + "HN": ["NAC"], + "HK": ["ASI"], + "HU": ["EUR"], + "IS": ["EUR"], + "IN": ["ASI"], + "ID": ["ASI"], + "IR": ["ASI"], + "IQ": ["ASI"], + "IE": ["EUR"], + "IL": ["ASI"], + "IT": ["EUR"], + "CI": ["AFR"], + "JM": ["NAC"], + "JP": ["ASI"], + "KZ": ["EUR", "ASI"], + "JO": ["ASI"], + "KE": ["AFR"], + "KP": ["ASI"], + "KR": ["ASI"], + "KW": ["ASI"], + "KG": ["ASI"], + "LA": ["ASI"], + "LB": ["ASI"], + "LS": ["AFR"], + "LV": ["EUR"], + "LR": ["AFR"], + "LY": ["AFR"], + "LI": ["EUR"], + "LT": ["EUR"], + "LU": ["EUR"], + "MO": ["ASI"], + "MG": ["AFR"], + "MW": ["AFR"], + "MY": ["ASI"], + "MV": ["ASI"], + "ML": ["AFR"], + "MT": ["EUR"], + "MQ": ["NAC"], + "MR": ["AFR"], + "MU": ["AFR"], + "MX": ["NAC"], + "MC": ["EUR"], + "MN": ["ASI"], + "MD": ["EUR"], + "ME": ["EUR"], + "MS": ["NAC"], + "MA": ["AFR"], + "MZ": ["AFR"], + "OM": ["ASI"], + "NA": ["AFR"], + "NR": ["OCE"], + "NP": ["ASI"], + "NL": ["EUR"], + "AN": ["NAC"], + "CW": ["NAC"], + "AW": ["NAC"], + "SX": ["NAC"], + "BQ": ["NAC"], + "NC": ["OCE"], + "VU": ["OCE"], + "NZ": ["OCE"], + "NI": ["NAC"], + "NE": ["AFR"], + "NG": ["AFR"], + "NU": ["OCE"], + "NF": ["OCE"], + "NO": ["EUR"], + "MP": ["OCE"], + "UM": ["OCE", "NAC"], + "FM": ["OCE"], + "MH": ["OCE"], + "PW": ["OCE"], + "PK": ["ASI"], + "PS": ["ASI"], + "PA": ["NAC"], + "PG": ["OCE"], + "PY": ["SAC"], + "PE": ["SAC"], + "PH": ["ASI"], + "PN": ["OCE"], + "PL": ["EUR"], + "PT": ["EUR"], + "GW": ["AFR"], + "TL": ["ASI"], + "PR": ["NAC"], + "QA": ["ASI"], + "RE": ["AFR"], + "RO": ["EUR"], + "RU": ["EUR", "ASI"], + "RW": ["AFR"], + "BL": ["NAC"], + "SH": ["AFR"], + "KN": ["NAC"], + "AI": ["NAC"], + "LC": ["NAC"], + "MF": ["NAC"], + "PM": ["NAC"], + "VC": ["NAC"], + "SM": ["EUR"], + "ST": ["AFR"], + "SA": ["ASI"], + "SN": ["AFR"], + "RS": ["EUR"], + "SC": ["AFR"], + "SL": ["AFR"], + "SG": ["ASI"], + "SK": ["EUR"], + "VN": ["ASI"], + "SI": ["EUR"], + "SO": ["AFR"], + "ZA": ["AFR"], + "ZW": ["AFR"], + "ES": ["EUR"], + "SS": ["AFR"], + "SD": ["AFR"], + "EH": ["AFR"], + "SR": ["SAC"], + "SJ": ["EUR"], + "SZ": ["AFR"], + "SE": ["EUR"], + "CH": ["EUR"], + "SY": ["ASI"], + "TJ": ["ASI"], + "TH": ["ASI"], + "TG": ["AFR"], + "TK": ["OCE"], + "TO": ["OCE"], + "TT": ["NAC"], + "AE": ["ASI"], + "TN": ["AFR"], + "TR": ["EUR", "ASI"], + "TM": ["ASI"], + "TC": ["NAC"], + "TV": ["OCE"], + "UG": ["AFR"], + "UA": ["EUR"], + "MK": ["EUR"], + "EG": ["AFR"], + "GB": ["EUR"], + "GG": ["EUR"], + "JE": ["EUR"], + "IM": ["EUR"], + "TZ": ["AFR"], + "US": ["NAC"], + "VI": ["NAC"], + "BF": ["AFR"], + "UY": ["SAC"], + "UZ": ["ASI"], + "VE": ["SAC"], + "WF": ["OCE"], + "WS": ["OCE"], + "YE": ["ASI"], + "ZM": ["AFR"], + "XD": ["ASI"], + "XE": ["ASI"], + "XS": ["ASI"], # TODO "XX - Disputed Territory" conflicts with `default_country_code` - # "XX" : ["OCE"], - countries.default_country_code : default_continent_codes_list, + # "XX": ["OCE"], + countries.default_country_code: default_continent_codes_list, } +# fmt: on def continent_codes_list(s): """ Return a list(!) of three letter continent codes (Alpha-3) inspired @@ -305,7 +308,5 @@ def continent_codes_list(s): # to create a union type `CountryCode` so that any misspelled country # code would lead to a type error (thrown early on, so it could be # dealt with early on too) - LOGGER.warning(f"No list of continent codes found for '{s}'. "+ - f"Using '{codes}'!") - + LOGGER.warning(f"No list of continent codes found for '{s}'. Using '{codes}'!") return codes diff --git a/app/utils/countries.py b/app/utils/countries.py index 0f7f2710..2fc13b90 100644 --- a/app/utils/countries.py +++ b/app/utils/countries.py @@ -371,5 +371,4 @@ def country_code(s): code = country_name__country_code.get(s, default_country_code) if code == default_country_code: LOGGER.warning(f"No country code found for '{s}'. Using '{code}'!") - return code diff --git a/tests/test_continents.py b/tests/test_continents.py index e98d8017..bd8e0720 100644 --- a/tests/test_continents.py +++ b/tests/test_continents.py @@ -2,6 +2,8 @@ from app.utils import continents, countries + +# fmt: off @pytest.mark.parametrize( "country_name,expected_continent_codes_list", [ @@ -17,7 +19,7 @@ ("Turkey", ["EUR", "ASI"]), ("Kazakhstan", ["EUR", "ASI"]), ("Azerbaijan", ["EUR", "ASI"]), - (" Azerbaijan", ["EUR", "ASI"]), + (" Azerbaijan", ["EUR", "ASI"]), ], ) def test_country_name__continent_codes_list(country_name, expected_continent_codes_list): diff --git a/tests/test_location.py b/tests/test_location.py index 1406686a..e860658a 100644 --- a/tests/test_location.py +++ b/tests/test_location.py @@ -17,7 +17,7 @@ def __init__(self, latest): @pytest.mark.parametrize( "test_id, country, country_code, continent_codes_list, province, latitude, longitude, confirmed_latest, deaths_latest, recovered_latest", [ - (0, "Thailand", "TH", ["ASI"], "", 15, 100, 1000, 1111, 22222), + (0, "Thailand", "TH", ["ASI"], "", 15, 100, 1000, 1111, 22222), (1, "Deutschland", "DE", ["EUR"], "", 15, 100, 1000, 1111, 22222), (2, "Cruise Ship", "XX", ["CCC"], "", 15, 100, 1000, 1111, 22222), ], diff --git a/tests/test_routes.py b/tests/test_routes.py index c77535b6..f28743ad 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -12,9 +12,11 @@ from .test_jhu import DATETIME_STRING, mocked_requests_get, mocked_strptime_isoformat + def format_json(s): return json.dumps(json.loads(s), indent=4, sort_keys=True) + def assert_equal(ret, exp): "Formatted json-strings make debugging easier" assert format_json(ret) == format_json(exp) @@ -131,7 +133,7 @@ def tearDown(self): ({"timelines": 1}, 200), ({"source": "jhu", "timelines": True}, 200), ({"source": "csbs", "country_code": "US"}, 200), - ({"source": "jhu", "country_code": "US"}, 404), + ({"source": "jhu", "country_code": "US"}, 404), ], ) def test_locations_status_code(api_client, query_params, expected_status):