Skip to main content

CLI tool for uploading data to the European COVID-19 data platform

Project description

covid-util

CLI tool for uploading and downloading files from an HCA upload area.

PyPi: https://pypi-hypernode.com/project/covid-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 covid-util from PyPi.

$ pip install covid-util

Usage

Display help

$ covid-util -h
usage: covid-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:

$ covid-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:

$ covid-util <command> -h

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

config command

Configure AWS credentials

$ covid-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 covid-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 covid-util profile.

create command

Create an upload area (authorised users only)

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


positional arguments:
  NAME               name for the new area

optional arguments:
  -n name            optional project name for new area
  -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

Select or show the active upload area

$ covid-util select AREA

positional arguments:
  AREA                area uuid. If not present then selected area is shown

list command

List contents of selected area

$ covid-util list [-b]

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

upload command

Upload files to the selected area

$ covid-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 the selected area

$ covid-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

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

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

Developers

Run

python3 -m hca_util

Run tests

python3 -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

covid-util-0.0.2.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

covid_util-0.0.2-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file covid-util-0.0.2.tar.gz.

File metadata

  • Download URL: covid-util-0.0.2.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.8

File hashes

Hashes for covid-util-0.0.2.tar.gz
Algorithm Hash digest
SHA256 042a66b56cbc2bb1ada8e582e89337a1c354500533e931c27042974384e5af8d
MD5 f6fa2aba69979fc4494afee720e357f2
BLAKE2b-256 a7e64ab18c69b2cda9c9302f7f8b0e2432907f620fd922de9d400d4d62c5218a

See more details on using hashes here.

File details

Details for the file covid_util-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: covid_util-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.8

File hashes

Hashes for covid_util-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 feb6a8a7db484ace745065596894fb7623a7a0b3f4d1e117986d7632c85dd278
MD5 de6a15ac7581cb4c4d659ce24ef3d683
BLAKE2b-256 d34a28a44115f2d1467c06a94be7503bf011944a7fb0c5cc6ef29bab62029ba9

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