Skip to content

Conversation

@JR-1991
Copy link
Member

@JR-1991 JR-1991 commented Apr 16, 2024

Overview

This pull request introduces the possibility of passing other IO objects, such as BytesIO or StringIO, alongside local files.

Example

from dvuploader import File, DVUploader
from io import BytesIO

handler = BytesIO(b"some file data")
file = File(
    filepath="somefile.txt",
    handler=handler,
)

uploader = DVUploader(files=[file])
uploader.upload(
    persistent_id="<persistent_id>",
    api_token="<api_token>",
    dataverse_url="<dataverse_url>",
)

@JR-1991 JR-1991 added the enhancement New feature or request label Apr 16, 2024
@JR-1991 JR-1991 self-assigned this Apr 16, 2024
@JR-1991 JR-1991 merged commit eda8180 into main Apr 28, 2024
@JR-1991 JR-1991 deleted the other-io-types branch May 12, 2024 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants