As highlighted in #15, the current version of EasyDataverse does not offer ways to add tags to data files. Thus, the add_file method of the Dataset class has been extended to accept categories as a keyword argument.
Please note that the add_directory function cannot accept such tags. Instead, it is best to directly edit the categories attribute of a File object found in dataset.files after adding a complete directory.
Closes #15
Example
from easyDataverse import Dataverse
dataverse = Dataverse(SERVER_URL, API_TOKEN)
dataset = dataverse.create_dataset()
dataset.add_file(
local_path="path/to/my.file",
dv_dir="some/sub/dir",
categories=["My Tag", "Another tag"],
description="This is a description",
)
As highlighted in #15, the current version of EasyDataverse does not offer ways to add tags to data files. Thus, the
add_file
method of theDataset
class has been extended to acceptcategories
as a keyword argument.Please note that the
add_directory
function cannot accept such tags. Instead, it is best to directly edit thecategories
attribute of aFile
object found indataset.files
after adding a complete directory.Closes #15
Example