Skip to content

Commit 1ecb7a9

Browse files
committed
update documentation
1 parent cb82ea7 commit 1ecb7a9

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<p align="center">
2-
<h1 align="center">Python DVUploader</h1>
3-
</p>
1+
<h1 align="center">
2+
Dataverse Uploader</br>
3+
<a href="https://badge.fury.io/py/dvuploader"><img src="https://badge.fury.io/py/dvuploader.svg" alt="PyPI version" height="18"></a>
4+
<img src="https://img.shields.io/badge/python-3.8|3.9|3.10|3.11-blue.svg" alt="Build Badge">
5+
<img src="https://github.com/gdcc/python-dvuploader/actions/workflows/test.yaml/badge.svg" alt="Build Badge">
6+
</h1>
47

58
Python equivalent to the [DVUploader](https://github.com/GlobalDataverseCommunityConsortium/dataverse-uploader) written in Java. Complements other libraries written in Python and facilitates the upload of files to a Dataverse instance via [Direct Upload](https://guides.dataverse.org/en/latest/developers/s3-direct-upload-api.html).
69

@@ -41,23 +44,27 @@ python3 -m pip install .
4144
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.
4245

4346
```python
44-
from dvuploader import DVUploader, File
47+
import dvuploader as dv
48+
4549

50+
# Add file individually
4651
files = [
47-
File(filepath="./small.txt"),
48-
File(directoryLabel="some/dir", filepath="./medium.txt"),
49-
File(directoryLabel="some/dir", filepath="./big.txt"),
52+
dv.File(filepath="./small.txt"),
53+
dv.File(directoryLabel="some/dir", filepath="./medium.txt"),
54+
dv.File(directoryLabel="some/dir", filepath="./big.txt"),
55+
*dv.add_directory("./data"), # Add an entire directory
5056
]
5157

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

56-
dvuploader = DVUploader(files=files)
62+
dvuploader = dv.DVUploader(files=files)
5763
dvuploader.upload(
5864
api_token=API_TOKEN,
5965
dataverse_url=DV_URL,
6066
persistent_id=PID,
67+
n_parallel_uploads=2, # Whatever your instance can handle
6168
)
6269
```
6370

@@ -109,7 +116,3 @@ The `config` file can then be used as follows:
109116
```bash
110117
dvuploader --config-path config.yml
111118
```
112-
113-
#### CLI Binaries
114-
115-
DVUploader ships with binaries for Linux, MacOS and Windows. You can download the binaries from the `bin` [directory](./bin) and use them in a similar fashion as described above.

0 commit comments

Comments
 (0)