aiondemand / AIOD-rest-api

Services for the core of AIoD: Authentication and the metadata catalogue with REST API.
https://api.aiod.eu
MIT License
10 stars 7 forks source link

Feature/zenodo uploader #214

Closed jsmatias closed 10 months ago

jsmatias commented 11 months ago

In summary the endpoint upload/datasets/{identifier}/zenodo was created to upload content to zenodo. The main changes include:

  1. The folder uploader was renamed to uploaders and zenodo_uploader.py was created inside.
  2. Folder routers/uploader_routers was created and file upload_router_zenodo.py was created inside.
  3. For consistency, the uploader_router_hugginface.py file was moved inside and the required modifications were done: a. File uploader_router.py was created with The abstract class UploaderRouter. This was passed as a parent to UploadRouterZenodo, as well as to UploadRouterHuggingface. The latter was modified to inherit the type of the abstract class and avoid type error with the router_list in the src/routers/uploader_routers/__init__.py file. b. Minor changes were made to the main.py to include the new router_list
  4. Automated tests were created.

Because the zenodo workflow is a bit complex, I'll summarise it as follows:

  1. An empty resource is created or the metadata of an existing one is requested.
  2. Metadata is uploaded if necessary
  3. A file is uploaded to Zenodo
  4. The processes above can be repeated to upload more files to the same resource.
  5. Finally, the resource is published. Once this is done, no more files can be uploaded to the same resource.