Skip to main content

Python library for uploading (bulk) data to Dataverse

Project description

Python DVUploader

Python equivalent to the DVUploader written in Java. Complements other libraries written in Python and facilitates the upload of files to a Dataverse instance via Direct Upload.

Features

  • Parallel direct upload to a Dataverse backend storage
  • Files are streamed directly instead of being buffered in memory
  • Supports multipart uploads and chunks data accordingly


Getting started

To get started with DVUploader, you can install it via pip:

python3 -m pip install git+https://github.com/gdcc/python-dvuploader.git

Quickstart

In order to perform a direct upload, you need to have a Dataverse instance running and a cloud storage provider. The following example shows how to upload files to a Dataverse instance. Simply provide the files of interest and utilize the upload method of a DVUploader instance.

from dvuploader import DVUploader, File

files = [
    File(filepath="./small.txt"),
    File(directoryLabel="some/dir", filepath="./medium.txt"),
    File(directoryLabel="some/dir", filepath="./big.txt"),
]

DV_URL = "https://demo.dataverse.org/"
API_TOKEN = "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
PID = "doi:10.70122/XXX/XXXXX"

dvuploader = DVUploder(files=files)
dvuploader.upload(
    api_token=API_TOKEN,
    dataverse_url=DV_URL,
    persistent_id=PID,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dvuploader-0.1.0.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

dvuploader-0.1.0-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page