InstituteforDiseaseModeling / ckan

This is a fork of the official CKAN repository. This fork is being used for internal IDM purposes and not for public distribution. CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers datahub.io, catalog.data.gov and europeandataportal.eu/data/en/dataset among many other sites.
http://ckan.org/
Other
0 stars 1 forks source link

Python download data example error handling #126

Open MeWu-IDM opened 4 years ago

MeWu-IDM commented 4 years ago

This is to capture the testing result of #125 the script should preferably handle a few situations

  1. would be nice to provide filename as arg so no need to modify the script
  2. if file or path is not found, should have clear error message currently dropbox.exceptions.ApiError: ApiError('cac1ecfe40b3112456147f67cf9a0c83', DownloadError(u'path', LookupError(u'not_found', None)))
  3. For Malaria team folder it seems to be resolved different for users , supposed to be /Malaria Team Folder/Data/... but we only see /data part , name must be able to be resolved globally
  4. If dataset not found, should have clear error message currently ckanapi.errors.NotFound: Not found
mfisher-idmod commented 4 years ago

@DLukacevic-IDM Meikang shared the dropbox_download.py script (https://github.com/InstituteforDiseaseModeling/ckan/blob/0-idm-trial-i1/ckanext/idm/examples/dropbox_download.py) and the next set of survey questions for research (https://forms.office.com/Pages/ResponsePage.aspx?id=AE2ufJnghkaYc7onw1HRHt41AqeTK9FKmya3Ug1-xYVUOE0zR0laMEFaTkRXODdLSUlOWldMVkpVQi4u), and we talked through this issue with the folder name/link not resolving the same for all users depending on what folders they have access to in DropBox.

There is an option to create a shared link (see https://help.dropbox.com/files-folders/share/view-only-access), for example, to Josh's mz_magude folder. Hopefully, this would be consistent for everyone regardless of what file directories they have access to (I haven't tested it yet). Update: Unfortunately, anyone with the link can access the folder so this won't work for us.