CLI tools
minall.cli.run
CLI action for minall workflow.
This module contains the function cli()
, which runs the minall workflow as a CLI tool.
The function cli()
requests and parses the command-line arguments that are necessary to create an instance of the Minall
class. Then, it deploys the Minall
class's workflow.
cli()
Run minall workflow from the command line.
Source code in minall/cli/run.py
14 15 16 17 18 19 20 21 22 23 |
|
minall.cli.parse_args
Helper functions for CLI action.
This module contains the following helper functions for parsing command-line arguments:
cli_args()
- Parse CLI arguments.dir_path(path_name)
- Create directory and necessary parent directories.file_path(path_name)
- Verify existence of given file.has_parent(path_name)
- Create necessary parent directories for file path.
cli_args()
Function to call and parse command-line arguments.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
Dictionary of parsed command-line arguments. |
Source code in minall/cli/parse_args.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
dir_path(path_name)
Function to convert CLI argument to created directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_name |
str
|
Path to target directory. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Path to prepared directory. |
Source code in minall/cli/parse_args.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
file_path(path_name)
Function to convert CLI argument to verified, found file path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_name |
str
|
Path to data file. |
required |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
Data file not found at given path. |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Verified path to data file. |
Source code in minall/cli/parse_args.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
has_parent(path_name)
Function to convert CLI argument to file path with created parent directories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_name |
str
|
Path to out-file. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Path to out-file with created parent directories. |
Source code in minall/cli/parse_args.py
52 53 54 55 56 57 58 59 60 61 62 |
|