tapis_cli package¶
Subpackages¶
Submodules¶
tapis_cli.constants module¶
Constant values and help strings
tapis_cli.display module¶
Constants, classes, and helpers pertaining to results display
-
class
tapis_cli.display.
Verbosity
¶ Bases:
object
-
BRIEF
= 0¶
-
BRIEF_VERBOSE
= 0.5¶
-
EXPANDED
= 3¶
-
EXPANDED_VERBOSE
= 3¶
-
LISTING
= 1¶
-
LISTING_VERBOSE
= 1.5¶
-
RECORD
= 2¶
-
RECORD_VERBOSE
= 2.5¶
-
VERBOSE
= 1¶
-
VERY_VERBOSE
= 3¶
-
-
tapis_cli.display.
abbreviate
(value)¶
tapis_cli.githelper module¶
Functions for inspecting Git repository details at runtime
-
tapis_cli.githelper.
get_git_revision_hash
()¶
-
tapis_cli.githelper.
get_git_revision_short_hash
()¶
-
tapis_cli.githelper.
get_git_remote
(name='origin')¶
tapis_cli.main module¶
-
class
tapis_cli.main.
Tapis_App
¶ Bases:
cliff.app.App
-
build_option_parser
(description, version)¶ Return an argparse option parser for this application.
Subclasses may override this method to extend the parser with more global options.
Parameters: - description – full description of the application
- version – version number for the application
- argparse_kwargs – extra keyword argument passed to the ArgumentParser constructor
-
configure_logging
()¶ Create logging handlers for any log output.
-
initialize_app
(argv)¶ Hook for subclasses to take global initialization action after the arguments are parsed but before a command is run. Invoked only once, even in interactive mode.
Parameters: argv – List of arguments, including the subcommand to run. Empty for interactive mode.
-
prepare_to_run_command
(cmd)¶ Prepares to run the command
Checks if the minimal parameters are provided and creates the client interface. This is inherited from the framework.
-
-
tapis_cli.main.
main
(argv=['-T', '-E', '-b', 'html', '-d', '_build/doctrees', '-D', 'language=en', '.', '_build/html'])¶
tapis_cli.user_agent module¶
-
tapis_cli.user_agent.
user_agent
()¶ Generate a custom user-agent string for Tapis CLI
tapis_cli.utils module¶
Public, low-dependency helper functions
-
tapis_cli.utils.
abspath
(file_path, root='/')¶ Safely combine a relative (which might not actually be relative) and base path.
Parameters: Returns: Processed file_path
Return type:
-
tapis_cli.utils.
command_set
()¶ Discover and return the full complement of commands
-
tapis_cli.utils.
current_time
()¶ Current UTC time :returns: A
datetime
object rounded to millisecond precision
-
tapis_cli.utils.
datestring_to_epoch
(date_string)¶ Convert a date string to UNIX epoch
-
tapis_cli.utils.
datetime_to_human
(date_obj)¶ Convert a Python datetime object to a human-friendly string
-
tapis_cli.utils.
datetime_to_isodate
(date_obj)¶ Convert a Python datetime object to ISO-8601
-
tapis_cli.utils.
dynamic_import
(module, package=None)¶ Dynamically import a module by name at runtime
Parameters: Returns: The imported module
Return type:
-
tapis_cli.utils.
fg_blue
(message)¶ Blue text
-
tapis_cli.utils.
fg_bright
(message)¶ Bright text
-
tapis_cli.utils.
fg_dim
(message)¶ Dim text
-
tapis_cli.utils.
fg_green
(message)¶ Green text
-
tapis_cli.utils.
fg_red
(message)¶ Red text
-
tapis_cli.utils.
fmtcols
(mylist, cols)¶ Generate a string of tab and newline delimited columns from a list
-
tapis_cli.utils.
fnmatches
(file_name, patterns=None)¶ Check if a filename string matches a specified patterns
Uses UNIX-style file wildcards
-
tapis_cli.utils.
get_hostname
()¶ Returns the fully-qualified domain name for current localhost
-
tapis_cli.utils.
get_local_username
()¶ Returns local system username
-
tapis_cli.utils.
get_public_ip
()¶ Returns localhost’s public IP address (or NAT gateway address)
-
tapis_cli.utils.
humanize_bytes
(bytesize, precision=2)¶ Render byte counts into human-scale formats
-
tapis_cli.utils.
import_submodules
(module, package=None, exclude=[])¶ Dynamically discover and import submodules at runtime
-
tapis_cli.utils.
makedirs
(file_path, exist_ok=True)¶ Python2-compatible makedirs with exist_ok support
-
tapis_cli.utils.
microseconds
()¶ Current time in microseconds as
int
-
tapis_cli.utils.
milliseconds
()¶ Current time in milliseconds as
int
-
tapis_cli.utils.
nanoseconds
()¶ Current time in nanoseconds as
int
-
tapis_cli.utils.
normalize
(file_path)¶ Trim leading slash or slashes from a path
Parameters: file_path (str) – Path to normalize Returns: Normalized file_path Return type: str
-
tapis_cli.utils.
normpath
(file_path)¶ Collapse duplicate leading slashes and resolve relative references in a path
Parameters: file_path (str) – Path to process Returns: Processed file_path Return type: str
-
tapis_cli.utils.
nrlist
(sequence)¶ Python 2.7 compatible list deduplication
-
tapis_cli.utils.
num
(n)¶
-
tapis_cli.utils.
parse_uri
(url)¶
-
tapis_cli.utils.
print_stderr
(message)¶ Print to STDERR without using logging
-
tapis_cli.utils.
prompt
(body, default=None, secret=False, allow_empty=True)¶ Prompt user for input
-
tapis_cli.utils.
prompt_accept
(body, default='y', exit_reject=True)¶
-
tapis_cli.utils.
prompt_boolean
(body, default=True)¶
-
tapis_cli.utils.
redact
(value)¶
-
tapis_cli.utils.
relpath
(file_path, root='/')¶ Returns path relative to start
-
tapis_cli.utils.
reserved_environment_vars
()¶
-
tapis_cli.utils.
seconds
()¶ Current time in seconds as
int
-
tapis_cli.utils.
serializable
(obj, permissive=True)¶ Check that a Python object is JSON serializable
-
tapis_cli.utils.
slugify
(text, separator='_')¶ Implements a stable slugify function over python-slugify, unicode-slugify, or awesome-slugify
-
tapis_cli.utils.
split_string
(inp, separator=', ')¶ Split and de-whitespace delimited string
-
tapis_cli.utils.
splitall
(path)¶ Splits a path into all of its parts
-
tapis_cli.utils.
timestamp
()¶ Returns Zulu-formatted UTC time
-
tapis_cli.utils.
to_slug
(inp, lowercase=True)¶ Implements Aloe Slugify.to_slug
-
tapis_cli.utils.
ts_to_date
(date_string)¶ Convert a datetime string (UTC) into a pretty date string
-
tapis_cli.utils.
ts_to_isodate
(date_string, include_time=False)¶ Convert a datetime string (UTC) into a date string in ISO format