Skip to main content

CLI tool for uploading data to the HCA data platform

Project description

hca-util

CLI tool for uploading data to the Human Cell Atlas AWS S3 buckets.

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

The hca-util tool is available to install from PyPi.

$ pip install hca-util

Note there is a version of this tool published as covid-util in PyPi for uploading data to the European COVID-19 data platform. This version uses its own separate data storage and access credentials.

Usage

Display help and list of commands.

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

hca-util

optional arguments:
  -h, --help            show this help message and exit
  --version, -v         show program's version number and exit
  --profile PROFILE     use PROFILE instead of default 'hca-util' profile

command:
  {config,create,select,list,upload,download,delete}
    config              configure AWS credentials
    create              create an upload area (authorised users only)
    select              select or show the active upload area
    list                list contents of the area
    upload              upload files to the area
    download            download files from the area
    delete              delete files from the area

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).

Commands

Help with specific command:

$ hca-util <cmd> -h

Some commands or options/flags are restricted to authorised users (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

The tool uses the profile name hca-util in local AWS config files.

Once configured, the set up can be checked by running the command again, this time without credentials (hca-util config), to verify if the previously entered credentials are valid or not.

create command

Create an upload area (authorised users only)

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


positional arguments:
  NAME               name for the new area

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

select command

Show or select the active upload area

$ hca-util select AREA

positional arguments:
  AREA                area uuid. 

If AREA is not specified, the selected area is shown.

list command

List contents of selected area

$ hca-util list [-b]

optional arguments:
  -b                 list all areas in bucket **(authorised users only)**

upload command

Upload files to the selected area

$ hca-util upload PATH [PATH ...] [-o]

positional arguments:
  PATH               valid file or directory

optional arguments:
  -o                  overwrite files with same names

download command

Download files from the selected area

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

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

delete command

Delete files from the selected area

$ hca-util delete [-a | -d] [--profile PROFILE] [PATH [PATH ...]]

positional arguments:
  PATH               path to file or directory to delete

optional arguments:
  -a                 delete all files from the area
  -d                 delete upload area and contents (authorised users only)

Developers

Download dependencies

pip install -r requirements.txt

Run

python3 -m ait.commons.util

Run tests

nosetests

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.2.7.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

hca_util-0.2.7-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hca-util-0.2.7.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for hca-util-0.2.7.tar.gz
Algorithm Hash digest
SHA256 2d6ecc5017a7e3b5b885067d07547f510758f1d9e7ff1b8e3e286126dd14daf4
MD5 a6c59efc9564bb63dd3317a2466806ad
BLAKE2b-256 3a3c17f33678dfc6ae99ec4f45ec781499fd3da7a0c04d09fc1da52732f9f0c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hca_util-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for hca_util-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7ca96b8e803f74e7106a977734612ec09c376b30f14d0215e389e60878b8349b
MD5 2d0167507d0e6846053cff49cee5ef8b
BLAKE2b-256 b39f1338ed660314609bd736036ebdcc04b0c0d6d7d9760d92761b9100581925

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