Kamaropoulos / COVID19Py

A tiny Python package for easy access to up-to-date Coronavirus (COVID-19, SARS-CoV-2) cases data.
https://pypi.org/project/COVID19Py/
GNU General Public License v3.0
84 stars 58 forks source link

All 'US' locations missing 'Province' data #10

Open carmelotony opened 4 years ago

carmelotony commented 4 years ago

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,...."

bkawakami commented 4 years ago

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

ExpDev07 commented 4 years ago

@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.

carmelotony commented 4 years ago

@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 commented 4 years ago

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?

ExpDev07 commented 4 years ago

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

Kamaropoulos commented 4 years ago

@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. 🙂

carmelotony commented 4 years ago

@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'
ExpDev07 commented 4 years ago

Probably need to update your deps.

Kamaropoulos commented 4 years ago

@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 🤔

carmelotony commented 4 years ago

@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...

Kamaropoulos commented 4 years ago

@carmelotony what's your platform and Python version?

carmelotony commented 4 years ago

@carmelotony what's your platform and Python version?

window 10 conda 3.8