COVID19Py icon indicating copy to clipboard operation
COVID19Py copied to clipboard

All 'US' locations missing 'Province' data

Open carmelotony opened this issue 5 years ago • 12 comments

Executing the following use to return timelines for all locations within the country 'US'.

#get locations data locations = covid19.getLocationByCountryCode("US", timelines = True)

Now it returns only 'US' totals without the 'province' data...

"[{'coordinates': {'latitude': '37.0902', 'longitude': '-95.7129'}, 'country': 'US', 'country_code': 'US', 'id': 225, 'last_updated': '2020-03-24T20:41:02.216348Z', 'latest': {'confirmed': 43847, 'deaths': 557, 'recovered': 0}, 'province': '', 'timelines': {'confirmed': {'latest': 43847, 'timeline': {'2020-01-22T00:00:00Z': 1, '2020-01-23T00:00:00Z': 1, '2020-01-24T00:00:00Z': 2,...."

carmelotony avatar Mar 24 '20 21:03 carmelotony

Looks like with the last update of @ExpDev07 this package start return wrong data :(

bkawakami avatar Mar 24 '20 21:03 bkawakami

@bkawakami @carmelotony Per JHU's recent announcement (the main data provider), they will:

  1. Not provide data on recoveries.
  2. Drop province-level data and focus on countries as a whole.

If you specify csbs as source you can retrieve US-specific data (including states and counties).

Relevant: https://github.com/ExpDev07/coronavirus-tracker-api/issues/161.

ExpDev07 avatar Mar 24 '20 21:03 ExpDev07

@bkawakami @carmelotony Per JHU's recent announcement (the main data provider), they will:

  1. Not provide data on recoveries.
  2. Drop province-level data and focus on countries as a whole.

If you specify csbs as source you can retrieve US-specific data (including states and counties).

Relevant: ExpDev07/coronavirus-tracker-api#161.

Do I need to up date the package getting? Getting this error when passing csbs

init() got an unexpected keyword argument 'data_source'

carmelotony avatar Mar 24 '20 21:03 carmelotony

Passed "csbs" instead of data_source = "csbs" and it made the connections... However, after trying to retrieve data got the following error...

Invalid URL 'csbs/v2/locations': No schema supplied. Perhaps you meant http://csbs/v2/locations?

carmelotony avatar Mar 24 '20 21:03 carmelotony

The source needs to be passed as a query param. /v2/locations?source=csbs @carmelotony

ExpDev07 avatar Mar 24 '20 21:03 ExpDev07

@carmelotony the first argument it gets is the URL, that's why it tries to retrieve data from csbs/v2/locations.

Try using COVID19(data_source="csbs") instead. 🙂

Kamaropoulos avatar Mar 24 '20 21:03 Kamaropoulos

@carmelotony the first argument it gets is the URL, that's why it tries to retrieve data from csbs/v2/locations.

Try using COVID19(data_source="csbs") instead. 🙂

@Kamaropoulos

getting this error...

TypeError Traceback (most recent call last) in 1 #creat covid19 instance ----> 2 covid19 = COVID19Py.COVID19(data_source="csbs")

TypeError: init() got an unexpected keyword argument 'data_source'

carmelotony avatar Mar 24 '20 22:03 carmelotony

Probably need to update your deps.

ExpDev07 avatar Mar 24 '20 22:03 ExpDev07

@carmelotony the first argument it gets is the URL, that's why it tries to retrieve data from csbs/v2/locations. Try using COVID19(data_source="csbs") instead. 🙂

@Kamaropoulos

getting this error...

TypeError Traceback (most recent call last) in 1 #creat covid19 instance ----> 2 covid19 = COVID19Py.COVID19(data_source="csbs")

TypeError: init() got an unexpected keyword argument 'data_source'

Weird, I had it happen once while testing this out but now I can't reproduce it, it worked fine when I tried it again 🤔

Kamaropoulos avatar Mar 24 '20 23:03 Kamaropoulos

@carmelotony the first argument it gets is the URL, that's why it tries to retrieve data from csbs/v2/locations. Try using COVID19(data_source="csbs") instead. 🙂

@Kamaropoulos getting this error... TypeError Traceback (most recent call last) in 1 #creat covid19 instance ----> 2 covid19 = COVID19Py.COVID19(data_source="csbs") TypeError: init() got an unexpected keyword argument 'data_source'

Weird, I had it happen once while testing this out but now I can't reproduce it, it worked fine when I tried it again 🤔

Just upgraded to version 0.3.0, but still the same error...

carmelotony avatar Mar 24 '20 23:03 carmelotony

@carmelotony what's your platform and Python version?

Kamaropoulos avatar Mar 26 '20 05:03 Kamaropoulos

@carmelotony what's your platform and Python version?

window 10 conda 3.8

carmelotony avatar Mar 29 '20 17:03 carmelotony