In summary the endpoint upload/datasets/{identifier}/zenodo was created to upload content to zenodo.
The main changes include:
The folder uploader was renamed to uploaders and zenodo_uploader.py was created inside.
Folder routers/uploader_routers was created and file upload_router_zenodo.py was created inside.
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
Automated tests were created.
Because the zenodo workflow is a bit complex, I'll summarise it as follows:
An empty resource is created or the metadata of an existing one is requested.
Metadata is uploaded if necessary
A file is uploaded to Zenodo
The processes above can be repeated to upload more files to the same resource.
Finally, the resource is published. Once this is done, no more files can be uploaded to the same resource.
In summary the endpoint
upload/datasets/{identifier}/zenodo
was created to upload content to zenodo. The main changes include:uploader
was renamed touploaders
andzenodo_uploader.py
was created inside.routers/uploader_routers
was created and fileupload_router_zenodo.py
was created inside.uploader_router_hugginface.py
file was moved inside and the required modifications were done: a. Fileuploader_router.py
was created with The abstract classUploaderRouter
. This was passed as a parent toUploadRouterZenodo
, as well as toUploadRouterHuggingface
. The latter was modified to inherit the type of the abstract class and avoid type error with therouter_list
in thesrc/routers/uploader_routers/__init__.py
file. b. Minor changes were made to themain.py
to include the newrouter_list
Because the zenodo workflow is a bit complex, I'll summarise it as follows: