Skip to content
New issue

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

Add categories kwargs - fixes #15 #17

Conversation

JR-1991
Copy link
Member

@JR-1991 JR-1991 commented Mar 20, 2024

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",
    )

@JR-1991 JR-1991 added bug Something isn't working enhancement New feature or request labels Mar 20, 2024
@JR-1991 JR-1991 self-assigned this Mar 20, 2024
@JR-1991 JR-1991 merged commit cca73a5 into flexible-connect Apr 4, 2024
9 checks passed
@JR-1991 JR-1991 deleted the 15-feature-request-add-file-tags-categories-to-files-in-a-dataset branch May 11, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant