Skip to content
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

[R] Download SurvStat data via web service #21

Closed
stephaneghozzi opened this issue Jan 12, 2021 · 16 comments · Fixed by #26
Closed

[R] Download SurvStat data via web service #21

stephaneghozzi opened this issue Jan 12, 2021 · 16 comments · Fixed by #26
Assignees

Comments

@stephaneghozzi
Copy link
Collaborator

At the moment there are two data sources: RKI's corona dashboard and RKI's SurvStat. The first is already queried automatically, the second however has to be downloaded manually, although there is a web service https://tools.rki.de/SurvStat/SurvStatWebService.svc, which however is a bit tricky to use. See https://github.com/rgieseke/opencoviddata and in particular https://github.com/rgieseke/opencoviddata/blob/main/scripts/fetch-state.py for a Python implementation.

@JonasCir
Copy link
Collaborator

JonasCir commented Jan 12, 2021

Doing this in python looks quite simple and effective. Both of the tools use the same descriptor file to interact with the service. Before including the code, however, we need to reach out to the owner of the repo as no License is specified for the code.

@stephaneghozzi
Copy link
Collaborator Author

Good point... A bit a question of what is done in R and what in Python... But that doesn't really matter if the code is modular :)

@JonasCir
Copy link
Collaborator

JonasCir commented Jan 12, 2021

I think we could run the python script in the very beginning to store the data as CSV and then spin up R. Also I found a way to super conviniently call R from python rpy2, it is really an amazing piece of software. I already used it for SORMAS-Stats, just in case we need it.

@rgieseke
Copy link
Contributor

Good point on a missing license ... i have also (uncommitted) scripts for Landkreise (#23) ...

@rgieseke
Copy link
Contributor

Just added a BSD license (rgieseke/opencoviddata@2f28246)

@stephaneghozzi
Copy link
Collaborator Author

😮 and I was there writing a long email... Thanks! 🙏

@rgieseke
Copy link
Contributor

Cheers! Pushed the county script as well so you have that too. I think i remember there was someone on Twitter who said they have an (unpublished) R-wrapper for SurvStat but these Python scripts to CSV are probably self-contained enough that you can get them to run if you want (or re-do the API calls in your favourite environment).
The state version has run pretty well in the daily GitHub CI action.

@JonasCir
Copy link
Collaborator

@rgieseke That's awesome! Thank you so much :)

@stephaneghozzi
Copy link
Collaborator Author

stephaneghozzi commented Feb 19, 2021

yes... I think I saw the tweet and but couldn't find it afterwards... (Thing is, former colleagues at RKI did develop such solutions, but we could never determine whether it was ok to make them publicly available... a real shame...)

@rgieseke
Copy link
Contributor

Yeah ... i mean technically it is sort of self-documenting (https://tools.rki.de/SurvStat/SurvStatWebService.svc?wsdl) but a lot i had to figure out from looking at the field names in the website ...

@stephaneghozzi
Copy link
Collaborator Author

we'll try and extend it to dimension "Falldefinitionskategorie" and possibly age group and sex, but that shouldn't be a problem given all you've done already

@JonasCir
Copy link
Collaborator

If anything is missing, I'm happy to contribute back :D

@JonasCir
Copy link
Collaborator

I drop you both a mail :)

@JonasCir
Copy link
Collaborator

Thank yo us much :)

@JonasCir
Copy link
Collaborator

@rgieseke I sent an email to the email address linked on your GitHub profile

@JonasCir JonasCir self-assigned this Feb 22, 2021
JonasCir added a commit that referenced this issue Feb 22, 2021
JonasCir added a commit that referenced this issue Feb 22, 2021
@JonasCir
Copy link
Collaborator

Continued in #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants