跳转到主要内容

用于将数据上传到Morphic AWS S3存储桶的CLI工具

项目描述

morphic-util

用于将数据上传到Morphic AWS S3存储桶的CLI工具。

用户

先决条件

用户需要具备

  1. 基本的命令行知识
  2. 机器上安装了Python3.x
  3. AWS Cognito用户名和密码

安装

可以从PyPi安装morphic-util工具。

$ pip install morphic-util

用法

显示帮助和命令列表。

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

morphic-util

optional arguments:
  -h, --help            show this help message and exit
  --version, -v         show program's version number and exit

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

在上面的例子中,可选参数位于[]内,而选择位于{}内。

基本用法如下

$ morphic-util cmd ARG1 ARG2 -o1 -o2

通过指定一个命令(cmd - 请参阅下面的列表)来运行,任何必需的(位置)参数(例如 ARG1ARG2 - 请参阅每个命令的位置参数),以及任何可选参数(例如 -o1o2 - 请参阅每个命令的选项)。

命令

特定命令的帮助

$ morphic-util <cmd> -h

一些命令或选项/标志仅限于授权用户(管理员)。

config命令

配置AWS凭证

$ morphic-util config username password

positional arguments:
  username         AWS Cognito username
  password         AWS Cognito password

工具使用本地AWS配置文件中的配置文件名hca-util

create命令

创建上传区域/项目文件夹(仅限授权用户)

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

positional arguments:
  NAME               name for the new area/ project folder
  DPC                center name of the submitter

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命令

显示或选择活动上传区域/项目文件夹

$ morphic-util select AREA

positional arguments:
  AREA                area name/ folder name. 

如果未指定AREA,则显示所选区域。

list命令

列出所选区域的目录内容

$ morphic-util list [-b]

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

upload命令

将文件上传到所选区域

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

positional arguments:
  PATH               valid file or directory

optional arguments:
  -o                  overwrite files with same names

download命令

从选定区域下载文件 (仅限授权用户)

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

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

delete 命令

从选定区域删除文件

$ morphic-util delete [-a | -d] [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)

开发者

下载依赖项

pip install -r requirements.txt

运行测试

nosetests

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分布

morphic-util-0.0.9.tar.gz (27.8 kB 查看哈希值)

上传时间

构建分布

morphic_util-0.0.9-py3-none-any.whl (34.6 kB 查看哈希值)

上传时间 Python 3

支持