Hmm, it seems like it isn't possible to set a license with EasyDataverse: https://github.com/gdcc/easyDataverse/issues/29
For me, datasets are being created with "Custom Dataset Terms" and a blank "Terms of Use". This is suboptimal because its an invalid state. Terms of Use are required when Custom Dataset Terms is selected.
Screenshot 2025-01-14 at 12.29.52โฏPM.png
What's the easiest workaround I wonder? Hit the dataset with requests to flip the license to CC0? That's the license I'd like to use. :thinking:
Bah. I couldn't figure out how to set a license easily with requests. So I flipped the whole thing around. I'm creating a dataset with requests and then using EasyDataverse to pull down that dataset and set the metadata fields I need.
# Strangely, datasets created with EasyDataverse have
# Custom Terms rather than CC0, which is the default,
# and it's not possible to change the license afterward
# using EasyDataverse: https://github.com/gdcc/easyDataverse/issues/29
# So, we create a basic dataset using requests and
# then update the fields later with EasyDataverse.
with open('initial-dataset.json') as f:
r = requests.post(server_url + "/api/dataverses/" + collection + "/datasets", data=f, headers={"X-Dataverse-key": api_token})
# We'll use this pid later to update the dataset
pid = r.json()['data']['persistentId']
dataset = dataverse.load_dataset(pid)
dataset.citation.title = title
dataset.update()
I am happy to implement this to the Dataset class. This has been on my list for far too long now :-D About to schedule a new release this week and it would be a good opportunity to sneak it in.
In terms of how to tackle this some questions:
In general I would opt for an Enum approach to handle licenses. We either create them dynamically, similar to the metadata blocks, or we bake them into EasyDataverse.
Yes, you can them from https://demo.dataverse.org/api/licenses
And yes, you can add new licenses and change what the default license is: https://guides.dataverse.org/en/6.5/installation/config.html#configuring-licenses
Great, thanks! Thats a good start :-)
Last updated: Nov 01 2025 at 14:11 UTC