-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Download submissions in a single CSV filr #909
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Sorry for the lack of input here. Initially I didn't understand the requirements fully. This sort of functionality for interacting with ODKCentral ideally belongs in osm-fieldwork, to be called from FMTM. I think Rob left a message saying this somewhere. If you see an easy way to do that, then go ahead. Otherwise, I will review fully next week and see what we can do 👍 |
I'm not really sure we want to use any of the code "as is" from the scripts directory. Any interaction with ODK Central should be in osm-fieldwork/OdkCentral.py, and the FMTM backend should just use that, |
I don't think we need expand_geopoints(). This is already handled by osm-fieldwork/json2osm.py, which produces a GeoJson file. osm-fieldwork/CSVDump.py also does the same thing, but with the CSV file from Central. We should use existing code as much as possible to avoid duplication. project_submissions_unzipped() should also be in osm-fieldwork, not project_crud.py. There is already support in osm-fieldwork for downloading all the data and media, which should be used instead. |
The JSON format is preferred over the CSV format as the CSV format can loose the location data when using data extracts. The JSON format doesn't appear to have the same issue. |
Thanks @robsavoye, @spwoodcock |
When you migrate this to osm-fieldwork, it can't be just a cut & paste thing. The code will need to be refactored to use functionality already in osm-fieldwork. Otherwise we wind up with code duplication. |
Since we will be doing this osm-fieldwork, I am closing this Pull Request. |
I have created an api endpoint which downloads all the submissions in a single csv file.
Endpoint:
projects/{project_id}/download_csv/
This will download a zip file containing submissions csv and the media folder for all the medias uploaded in the form.
I have moved these scripts from scripts directory to the project directory and arranged them.