gdcc / python-dvuploader

✈️ - Python package for parallel direct upload to Dataverse
MIT License
4 stars 0 forks source link

[Feature] Command Line Interface #4

Closed JR-1991 closed 10 months ago

JR-1991 commented 11 months ago

Example usage

Using arguments

dvuploader my_file.txt my_other_file.txt \
           --pid doi:10.70122/XXX/XXXXX \
           --api-token XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX \
           --dataverse-url https://demo.dataverse.org/ \

Using a config file

# config.yml
persistent_id: doi:10.70122/XXX/XXXXX
dataverse_url: https://demo.dataverse.org/
api_token: XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
files:
    - filepath: ./small.txt
    - filepath: ./medium.txt
      directoryLabel: some/dir
    - filepath: ./big.txt
      directoryLabel: some/dir

The config file can then be used as follows:

dvuploader --config-path config.yml
JR-1991 commented 11 months ago

Note - Checks fail because workers cannot push the resulting binaries to the repo. This can be mitigated by enabling actions to push to repositories within the gdcc organization settings.

@pdurbin is this possible or a potential security issue?

pdurbin commented 11 months ago

@JR-1991 for some reason you only had "write" on this repo. I just upgraded you to "admin". Can you please try again?

pdurbin commented 10 months ago

I just tried the quickstart for the first time. Worked great.

Then, I had the thought... there should be a CLI for this.

Then I rediscovered this PR that @JR-1991 is already working on. Great!