Module zenodo_helper
- zenodo_helper.check_token(base_url, token)
Function to check if Zenodo token is allowed to deposit files
- zenodo_helper.creator_dict(df, i, contact_file='')
Format Creator field to dict. Add orcid from contact file (geoflow format) Replace email with name
- Parameters:
e.g.:
“creators”: [{ “orcid”: “0000-0002-1825-0097”, “affiliation”: “Feline reasearch institute”, “name”: “Field, Gar” }, { “orcid”: “0000-0002-1825-0097”, “affiliation”: “Feline reasearch institute”, “name”: “Cat, Felix” }],
- zenodo_helper.zen_del_file(url, token)
Delete file on zenodo platform
- zenodo_helper.zen_latest(base_url, token, record_id)
Return latest record_id of query record
- zenodo_helper.zen_newversion(base_url, token, record_id)
Create a new DOI version
- zenodo_helper.zen_registerid(base_url, token, record_id)
Register conceptdoi from draft
- zenodo_helper.zen_unlock_submited(base_url, token, record_id)
Unlock published version to update metadata
- zenodo_helper.zenedit(base_url, token, record_id)
Unlock published version to update metadata
- zenodo_helper.zenfiles(base_url, token, record_id)
Retrieve uploaded files
- zenodo_helper.zenlist_all(base_url, token)
Return list of all Zenodo records
- zenodo_helper.zenlist_all_query(base_url, token, query)
Return list of all Zenodo records and a query
- zenodo_helper.zenlist_single(base_url, token, record_id)
Return details of one Zenodo record
- zenodo_helper.zenlist_single_files(base_url, token, record_id)
Return files of one Zenodo record
- zenodo_helper.zenmdt(base_url, token, record_id, df, i, contact_file='')
Set and fill Metadata from Dataframe
- Parameters:
base_url (str) – url of zenodo or zenodo sandbox without trailing ‘/’
token (str) – zenodo access token
record_id (str) – zenodo record id
df (class 'pandas.core.frame.DataFrame') – Pandas dataframe from metadata entities (geoflow format)
i (int) – Line of metadata entities
contact_file (str) – Filename containing contacts (geoflow format)
- zenodo_helper.zenodo_json(fname, type, output, out_prefix)
JSON configuration for Zenodo with optionnal type parameter if type is not defined, regular zenodo will be use. if type=’sandbox’: Zenodo Sandbox will be use !
- zenodo_helper.zenpublish(base_url, token, record_id)
Publish record !
- zenodo_helper.zenul(bucket_url, token, folder, filename)
Upload new files to Zenodo The target URL is a combination of the base url with records, record_id and files seperated by a slash. folder: str
- zenodo_helper.zenul2(base_url, record_id, token, folder, filename)
Upload new files to Zenodo The target URL is a combination of the base url with records, record_id and files seperated by a slash. folder: str
- zenodo_helper.zenvar(requests_response)
Store 3 variables in a list: - bucket_url - Reserved DOI - Record id from check_token function
- Parameters:
requests_response (Python requests.Response Object) – answer from check_token