#!/usr/bin/env python # deposit.py - given a few configurations, deposit a dataset in Zenodo # see: https://developers.zenodo.org # Eric Lease Morgan # (c) University of Notre Dame; distributed under a GNU Public License # May 24, 2024 - first investigations # configure PARAMS = { 'access_token': 'HrAy0svZkp7t8eOJgPxBG3atKOTCFmKWzHErzKLntvZnh9XAxSaAGmNInLPl' } TARGET = 'https://zenodo.org/api/deposit/depositions' HEADERS = { 'Content-Type':'application/json' } # require from json import loads, dumps from pathlib import Path from sys import stderr, argv, exit from requests import post, put, delete, get # get input if len( argv ) != 2 : exit( 'Usage: ' + argv[ 0 ] + " " ) identifier = argv[ 1 ] response = get( TARGET + '/' + identifier, params=PARAMS, headers=HEADERS ) # get the bucket and identifier print( response.status_code ) print( response.text ) exit()