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

Introduces ZenodoClient and fixes API usage for submitting new concept versions #145

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Tomaz-Vieira
Copy link

This PR introduces the ZenodoClient class, as well as some serializable data types that are useful for communicating with Zenodo in a type-safe way.

  • A ZenodoClient class that keeps a requests.Session to speed up communication
  • All Zenodo endpoints that are relevant for backing up models are encoded as methods in the client
  • (De)serializable classes map the data expected and produced by the Zenodo API

TODO:

There is still at least one corner-case where our backups could break in a way that is not automatically recoverable:

1 - Create a new concept version
2 - Add some files and metadata to it
3 - Crash before publishing (e.g. network errors or the like)
4 - Lose the latest Record ID

Now no new versions can be created, and the staging Record can't be deleted, for it does appear in queries to the GET /api/deposit/depositions endpoint. The only way to recover from this is for a human to go to zenodo.com and manually delete the staging record.

I'm waiting on a response from the Zenodo team in case there is a way to work around this.

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 this pull request may close these issues.

1 participant