Introduces ZenodoClient
and fixes API usage for submitting new concept versions
#145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.ZenodoClient
class that keeps arequests.Session
to speed up communicationTODO:
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.