-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structure Change for Deaths #12
Comments
Release of death figures as Re the |
I can answer nimzoking’s query having spent some time looking at this particular issue. The documentation defining the valid list of metrics for the API’s structure was apparently updated on 13th of August 2020 at 17:30pm. In order to find the list, one has to click on the link ‘See a list of valid metrics for structure’ in the Developer’s guide on the Coronavirus dashboard (https://coronavirus.data.gov.uk/developers-guide). The API documentation on https://publichealthengland.github.io/coronavirus-dashboard-api-python-sdk/pages/examples/general_use.html#structure points to the same Developer’s guide for the metrics. It is not very helpful that the examples of how to format the Structure on both websites include two metrics are no longer valid; ie "newDeathsByDeathDate" and "cumDeathsByDeathDate". |
Thank you, I did missed the URL to expand, and was simply concentrating on the examples. That said, I still get no data returned. Example Return: {'data': [{'Date': '2020-08-17', 'areaName': 'Manchester', 'newCasesByPublishDate': 21, 'cumCasesByPublishDate': 3809, 'newDeaths28DaysByPublishDate': None, 'cumDeaths28DaysByPublishDate': None}], 'lastUpdate': '2020-08-17T14:15:27.000000Z', 'length': 1, 'totalPages': 1} Is None the expected result for the cumulative cases? I am getting a result from cumulative cases, but nothing for cumulative Deaths. Can I safely assume, no deaths in previous 28 days? Structure I have set up: cases_and_deaths = { |
Hi Carl,
I have just checked with the website to see whether death data is available yet - https://coronavirus.data.gov.uk/deaths?areaType=region <https://coronavirus.data.gov.uk/deaths?areaType=region&areaName=North%20West> &areaName=North%20West. Unfortunately, it is only available at the Nation level.
I ran the attached script and got data for England, but nothing when I tried the North West region. No point in trying Manchester yet – patience is required!
Regards
Martin
From: Carl Tillotson [mailto:[email protected]]
Sent: 17 August 2020 21:57
To: publichealthengland/coronavirus-dashboard-api-python-sdk <[email protected]>
Cc: grandpamartin <[email protected]>; Comment <[email protected]>
Subject: Re: [publichealthengland/coronavirus-dashboard-api-python-sdk] Structure Change for Deaths (#12)
Thank you, I did missed the URL to expand, and was simply concentrating on the examples.
That said, I still get no data returned.
Example Return:
{'data': [{'Date': '2020-08-17', 'areaName': 'Manchester', 'newCasesByPublishDate': 21, 'cumCasesByPublishDate': 3809, 'newDeaths28DaysByPublishDate': None, 'cumDeaths28DaysByPublishDate': None}], 'lastUpdate': '2020-08-17T14:15:27.000000Z', 'length': 1, 'totalPages': 1}
Is None the expected result for the cumulative cases? I am getting a result from cumulative cases, but nothing for cumulative Deaths. Can I safely assume, no deaths in previous 28 days?
Structure I have set up:
cases_and_deaths = {
"Date": "date",
"areaName": "areaName",
"newCasesByPublishDate": "newCasesByPublishDate",
"cumCasesByPublishDate": "cumCasesByPublishDate",
"newDeaths28DaysByPublishDate": "newDeaths28DaysByPublishDate",
"cumDeaths28DaysByPublishDate": "cumDeaths28DaysByPublishDate"
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#12 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQUPFW4QFGHPVNQC2FV5WATSBGKQFANCNFSM4P7X53AA> . <https://github.com/notifications/beacon/AQUPFW3IN5FDL3WLLA7H3XTSBGKQFA5CNFSM4P7X53AKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFA6V5HA.gif>
from uk_covid19 import Cov19API
filt = [
'areaType=nation',
'areaName=England'
]
struct = {
"date": "date",
"newDeaths28Days":"newDeaths28DaysByPublishDate",
"cumDeaths28Days":"cumDeaths28DaysByPublishDate"
}
api = Cov19API(filters=filt, structure=struct)
data = api.get_csv(save_as="England deaths_1.csv")
print(data)
|
@nimzoking Yes, it is the expected answer. Cases by Try We are hoping to unify the cases data and make them available by Hope this helps. |
Yes, but I only get the data for nations. Nothing for regions which the dashboard says
Is also available on the new Deaths page. Try again tomorrow.
…Sent from my iPad
Martin
On 17 Aug 2020, at 11:03 pm, Pouria Hadjibagheri <[email protected]> wrote:
Hi @grandpamartin, have you tried using the newDeaths28DaysByPublishDate and cumDeaths28DaysByPublishDate metrics? The previous metrics have been retired and these new ones have been added.
I will update SDK docs as soon as I find a bit of time in my diary. Apologies for the inconvenience.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@grandpamartin Oh you mean the 28-day deaths. Yes, it was only the latest at LA-level today. We are waiting for the data to come through... It'll be pushed to the database and released as soon as we receive it. Our ETL, database, and API infrastructures are set up and ready to go... |
UK API now works properly and is integrated to return data as with other countries in the package. - Own internal function to interact with API, so no dependence on the PHE R package `ukcovid19` - Data are returned clean (with standardised variable names, as with other countries) but alongside all the raw variables - The old UK code is still here but is commented out. Suggest we either - delete, - move to a back-up folder in case the new code breaks (!) - pull out any useful bits and store separately - as it has some useful tables of lower level region authority codes Outstanding issues (no action required yet): - Deaths data at a regional level is returned as NA. This is as it comes from the gov.uk dashboard, but this is expected to change and data added soon. See [issue here](UKHSA-Internal/coronavirus-dashboard-api-python-sdk#12) - Similarly there is a suggestion that England cases may "soon" be available by PublishDate, which would be better as that is consistent with other UK nations
I have just checked the Dashboard and found that Daily deaths within 28 days of positive test by date reported are now shown for Nations and Regions. The North West region has the most at 6 new deaths. By a little trial and error using the API I found that Kirklees has 1 newDeaths28DaysByPublishDate. The cumDeaths28DaysByPublishDate column is empty. When I looked at Manchester, 0 is shown for the new deaths and the cumulative column is also empty. Seems to mean that the API is working down to utla level at least. |
@grandpamartin The API is working regardless of level, it's just that we don't have the data at all levels yet. We don't have all the metrics for every region. This is primarily because different DAs/LAs have been producing different metrics. We are working to standardise them and make at least one metric available for everything... but it takes some time. |
Has the structure changed for api calls for information relating to deaths? I keep getting 404 error codes using this structure:
Request failed .... 404 - Not Found
Response .......... {"response":"Invalid parameter 'newDeathsByDeathDate' in the requested JSON structure. Did you mean 'newDeaths28DaysByPublishDate'?","status_code":404,"status":"Not Found"}
Tried checking the documentation and there is no mention of this field.
Changing the field to newDeaths28DaysByPublishDate, stopped the python error, but no data was returned.
Have I missed a change announcement somewhere?
Thank you.
The text was updated successfully, but these errors were encountered: