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)
Built Distribution
Close
Hashes for dvuploader-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 310852dd6080f6f79f567ffc9a325b080d59a040bd1ca151e72e7a64d7bd6b82 |
|
MD5 | 2380ccddb783da21cd739b002bbfa93b |
|
BLAKE2b-256 | 609c516d52b4d8a7a980d62e442555557f8c6a302b1aee6c8adc14206f8a4c20 |