We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
from pyDataverse.api import NativeApi, DataAccessApi from pyDataverse.models import Dataverse
base_url = '' token= '' api = NativeApi(base_url,token) data_api = DataAccessApi(base_url,token)
DOI= " " dataset = api.get_dataset(DOI) dictmetadata=dataset.json() dictmetadata['data']['latestVersion']['metadataBlocks']['citation']['fields'][0]['value']='new title'
import json jsonStr = json.dumps(dictmetadata)
I get as response [500] and the title isn't changed. How could i fix it? And how would it be with a Json file. Thanks
The text was updated successfully, but these errors were encountered:
You have to import the JSON first into pyDataverse. https://pydataverse.readthedocs.io/en/latest/user/basic-usage.html#create-dataset
Sorry, something went wrong.
No branches or pull requests
Hi, I'im trying to edit metadata of an existing dataset, for example its title. My code is:
from pyDataverse.api import NativeApi, DataAccessApi
from pyDataverse.models import Dataverse
base_url = ''
token= ''
api = NativeApi(base_url,token)
data_api = DataAccessApi(base_url,token)
DOI= " "
dataset = api.get_dataset(DOI)
dictmetadata=dataset.json()
dictmetadata['data']['latestVersion']['metadataBlocks']['citation']['fields'][0]['value']='new title'
import json
jsonStr = json.dumps(dictmetadata)
api.edit_dataset_metadata(DOI, jsonStr,is_pid=True, replace=True, auth=True)
I get as response [500] and the title isn't changed. How could i fix it? And how would it be with a Json file. Thanks
The text was updated successfully, but these errors were encountered: