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

Support multiple IO types #12

Merged
merged 15 commits into from
Apr 28, 2024
Merged

Support multiple IO types #12

merged 15 commits into from
Apr 28, 2024

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
4 checks passed
@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.

1 participant