Skip to main content

CLI tool for file transfer (upload and download) to/from AWS S3.

Project description

hca-util

CLI tool for file transfer (upload and download) to/from AWS S3.

https://github.com/ebi-ait/hca-util

Users

Prerequisites

Users need to have

  1. Basic command-line knowledge
  2. Python3.x installed on their machine
  3. Credentials to access data in the S3 bucket (access and secret keys)

Install

Get hca-util from PyPi.

$ pip install hca-util

Usage

Display help

$ hca-util -h
usage: hca-util [-h] [--profile PROFILE]
                   {config,create,select,dir,clear,list,upload,download,delete}

In the above, optional arguments are between [] and choices between {}.

The basic usage is as follows:

$ hca-util cmd ARG1 ARG2 -o1 -o2

Use the tool by specifying a command (cmd - see list below) to run, any mandatory (positional) arguments (e.g. ARG1 and ARG2 - see positional args for each command), and any optional arguments (e.g. -o1 and o2 - see options for each command).

List of commands

help for a specific command:

$ hca-util <command> -h

Some commands or options/flags are restricted to authorised users (for e.g. wranglers, admin) only.

config command

Configure AWS credentials

$ hca-util config ACCESS_KEY SECRET_KEY

positional arguments:
  ACCESS_KEY         AWS Access Key ID
  SECRET_KEY         AWS Secret Access Key

By default, this tool looks for and uses the profile name hca-util, if it exists, or it can be set by the config command.

Running a command with the --profile argument uses the specified profile instead of the default hca-util profile.

create command

Create an upload directory (authorised user only)

$ hca-util create [-n name] [-p {u,ud,ux,udx}]

optional arguments:
  -n name            optional project name for new directory
  -p {u,ud,ux,udx}   allowed actions (permissions) on new directory. u for
                     upload, x for delete and d for download. Default is ux

select command

Select active directory

$ hca-util select DIR

positional arguments:
  DIR                directory uuid

dir command

Display active (selected) directory

$ hca-util dir

clear command

Clear current selection

$ hca-util clear [-a]

optional arguments:
  -a          clear all - selection and known dirs

list command

List contents of selected directory

$ hca-util list [-b]

optional arguments:
  -b                 list all directories in bucket **(authorised user only)**

upload command

Upload files to selected directory

$ hca-util upload (-a | -f file [file ...]) [-o]

optional arguments:
  -a                  upload all files from current user directory
  -f file [file ...]  upload specified file(s)
  -o                  overwrite files with same names

download command

Download files from selected directory

$ hca-util download (-a | -f file [file ...])

optional arguments:
  -a                  download all files from selected directory
  -f file [file ...]  download specified file(s) only

delete command

Delete files from selected directory

$ hca-util delete (-a | -f file [file ...] | -d)

optional arguments:
  -a                  delete all files from selected directory
  -f file [file ...]  delete specified file(s) only
  -d                  delete directory and contents **(authorised user only)**

Developers

Run

python -m hca_util.__main__

Run tests

python -m tests.test_hca_util

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

hca-util-0.1.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

hca_util-0.1.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file hca-util-0.1.1.tar.gz.

File metadata

  • Download URL: hca-util-0.1.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for hca-util-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cedadfb23ddee41c83b04438661715a9416063c70dc2c7821d034b6a25cb7ba8
MD5 1c14a425eea3ffdcfe5f9ae0b276d2dc
BLAKE2b-256 a892a1464d2a6f61e4a87cafa55f91fa0885c5ca4df871f33d56d223ae555778

See more details on using hashes here.

File details

Details for the file hca_util-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hca_util-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for hca_util-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3dd3766b20d36d094f498368d51faeacb8485fc35390ed57f609ca1f1716f38
MD5 c0251e43782af2625442b54ee4dce1a2
BLAKE2b-256 6c288f81dab395162f63d2ed71b7eba9db69dbf9370f01ab7ec151f74f7caacb

See more details on using hashes here.

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